You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by mj...@apache.org on 2016/08/24 19:45:56 UTC

[35/41] incubator-joshua git commit: bugfix: resetting global decoder state

bugfix: resetting global decoder state

We are getting random failures in LmOovFeatureTest.java, but only when run as a group. I printed the stack trace around the error and noticed it's a call to getting the state index in ComputeNodeResult, with a state index of 1, which shouldn't happen because only one LM is loaded. So it seems that the bug is cause by some earlier test not calling Decoder.resetGlobalState() in cleanup. So I put a call to that in the constructor. This passes the tests but I'm not sure it's correct, and it's definitely not the right way to go about things. The ideal way to solve this is to get rid of global state.


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/d4fdbfd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/d4fdbfd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/d4fdbfd8

Branch: refs/heads/JOSHUA-304
Commit: d4fdbfd88bab99e244d3ed1fc9cff4ba5e6d124c
Parents: 4812fed
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 21:57:06 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 21:57:06 2016 -0500

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/decoder/Decoder.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d4fdbfd8/src/main/java/org/apache/joshua/decoder/Decoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/Decoder.java b/src/main/java/org/apache/joshua/decoder/Decoder.java
index d524a27..2d753c1 100644
--- a/src/main/java/org/apache/joshua/decoder/Decoder.java
+++ b/src/main/java/org/apache/joshua/decoder/Decoder.java
@@ -149,6 +149,8 @@ public class Decoder {
     this.grammars = new ArrayList<>();
     this.threadPool = new ArrayBlockingQueue<>(this.joshuaConfiguration.num_parallel_decoders, true);
     this.customPhraseTable = null;
+    
+    resetGlobalState();
   }
 
   /**