Bug 1008251 - Rejected translation will cause an error in TM
Rejected translation will cause an error in TM
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-Logic (Show other bugs)
3.0
Unspecified Linux
unspecified Severity medium
: ---
: 3.2
Assigned To: Patrick Huang
Ding-Yi Chen
:
: 997717 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-15 19:40 EDT by Patrick Huang
Modified: 2014-02-18 01:48 EST (History)
4 users (show)

See Also:
Fixed In Version: 3.2-SNAPSHOT (20131112-0036)
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-18 01:48:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Patrick Huang 2013-09-15 19:40:53 EDT
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
Build Identifier: 

When rejects a Translated or Approved translation, afterwards TM will refresh and it will encounter an error (viewable in browser console or server log). Debugging shows lucene search returns the newly Rejected translation even though we ask it to exclude Rejected state. Revisit the row (i.e.by move down then up again) this error goes away. I think this is because lucene index update is not synchronized with the database change. When the TM request comes in lucene still thinks the string is in previous state and serves it up. And the database (or perhaps ehcache) returns the actual object the state became Rejected.

Reproducible: Always

Steps to Reproduce:
1. Find a string with Translated or Approved state
2. Reject it
3. Check Firefox firebug console or Chrome console or server log
Actual Results:  
09:27:32,813 ERROR [org.zanata.webtrans.server.SeamDispatch] (http-/0.0.0.0:9898-4) Error dispatching action: java.lang.RuntimeException: Cannot map content state: Rejected
: java.lang.RuntimeException: Cannot map content state: Rejected
        at org.zanata.webtrans.server.rpc.GetTransMemoryHandler.fromContentState(GetTransMemoryHandler.java:164) [classes:]
        at org.zanata.webtrans.server.rpc.GetTransMemoryHandler.processIndexMatch(GetTransMemoryHandler.java:139) [classes:]
        at org.zanata.webtrans.server.rpc.GetTransMemoryHandler.searchTransMemory(GetTransMemoryHandler.java:104) [classes:]
        at org.zanata.webtrans.server.rpc.GetTransMemoryHandler.execute(GetTransMemoryHandler.java:88) [classes:]
        at org.zanata.webtrans.server.rpc.GetTransMemoryHandler.execute(GetTransMemoryHandler.java:1) [classes:]


Expected Results:  
Should not return Rejected translation as TM result
Comment 1 Patrick Huang 2013-09-15 21:55:08 EDT
doesn't seem to easily reproducible. Could be just timing issue.
Comment 2 Patrick Huang 2013-09-17 01:04:10 EDT
https://github.com/zanata/zanata-server/pull/181
Comment 3 Sean Flanigan 2013-09-17 20:16:23 EDT
See also bug 997717.
Comment 4 Patrick Huang 2013-09-17 20:24:49 EDT
*** Bug 997717 has been marked as a duplicate of this bug. ***
Comment 5 Ding-Yi Chen 2013-11-12 02:03:35 EST
VERIFIED with Zanata version 3.2-SNAPSHOT (20131112-0036)

Note You need to log in before you can comment on or make changes to this bug.