Opened 6 years ago
Closed 6 years ago
#16679 closed defect (fixed)
Troubleshoot DrawActionTest.testTicket12011
Reported by: | Don-vip | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.09 |
Component: | Unit tests | Version: | |
Keywords: | deadlock | Cc: | ris, michael2402, floscher, wiktorn, simon04, stoecker |
Description
For quite some time we have an unstable test:
org.openstreetmap.josm.actions.mapmode.DrawActionTest.testTicket12011
It fails quite often, more often when the server is stressed. The fact that the error is a timeout makes me think we have a race condition leading to a deadlock.
Any help welcome to diagnose the error as I can't find enough time to do it.
Attachments (0)
Change History (4)
follow-up: 2 comment:1 by , 6 years ago
comment:2 by , 6 years ago
Replying to wiktorn:
I took a look at it.
Thanks!
First solution that comes to my mind is to move whole
UndoRedoHandler.undo
to EDT thread so the locking will occur within the same thread and problem will not occur.
No better idea, I think we can give it a try.
comment:3 by , 6 years ago
Milestone: | → 18.09 |
---|
I took a look at it. Relevant thread dump:
Monitor addresses doesn't match, but looking at the code, it looks like we have following code in UndoRedoHandler:
We acquire DataSet write lock in UndoRedoHandler in main thread and
runInEDTAndWait
s to process selectionChangedEvents. And in DrawAction.selectionChanged we try to require lock on DataSet because we change highligted element.First solution that comes to my mind is to move whole
UndoRedoHandler.undo
to EDT thread so the locking will occur within the same thread and problem will not occur.I'm not sure what kind of race we have here, that the code takes different path. I guess that it might be connected with which primitve gets highlighted or something.