Bug 1008251 - Rejected translation will cause an error in TM
Summary: Rejected translation will cause an error in TM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Logic
Version: 3.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.2
Assignee: Patrick Huang
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
: 997717 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-15 23:40 UTC by Patrick Huang
Modified: 2014-02-18 06:48 UTC (History)
4 users (show)

Fixed In Version: 3.2-SNAPSHOT (20131112-0036)
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-18 06:48:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Patrick Huang 2013-09-15 23:40:53 UTC
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-16 01:55:08 UTC
doesn't seem to easily reproducible. Could be just timing issue.

Comment 2 Patrick Huang 2013-09-17 05:04:10 UTC
https://github.com/zanata/zanata-server/pull/181

Comment 3 Sean Flanigan 2013-09-18 00:16:23 UTC
See also bug 997717.

Comment 4 Patrick Huang 2013-09-18 00:24:49 UTC
*** Bug 997717 has been marked as a duplicate of this bug. ***

Comment 5 Ding-Yi Chen 2013-11-12 07:03:35 UTC
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.