Concurrency and background tasks in constraint checker
Observed Problems
There are no 100% reliable steps-to-reproduce, but most of the time executing steps 1-4 from #3558 result into the problems listed below. Also, the stack traces attached to the ticket should enable the analysis.
Hints:
- Enabling both checks before starting the test seems to increase the chance to hit the errors.
- Fast editing in the code specification editor (e.g., copy and paste, undo/redo) intermixed with saves seems to have an effect, too.
I observed 3 problems
- Prevented deadlock
- trace-to-avoid-deadlock-during-Display-syncExec.txt
- See
ConstraintUIBaseAutocheck::onOutdate
: The problem seems to be caused by the auto check code that runs a command inside theIConstraintService::verify()
method which in turn performs aDisplay.syncExec()
.
- Reentrant call while viewer is busy
- trace-reentrent-call-while-viewer-is-busy.txt
- Observed only once
- Sometimes, the model is marked dirty again after saving
Ideas to improve the design and user experience
When an expensive constraint is enabled, a “background operation about to start dialog” is shown:
- Suggested formulation changes:
- AutoFOCUS3 will now analyze your project in order to check that output ports…" —>start included constraint description with lower case letter.
- This might slow down your system […] should be unnoticed —>
- Note that AutoFOCUS3 might be less responsive until the check has been applied to the current model. Subsequent checks will be performed incrementally and should have no noticeable performance impact.
- Should not the progress view be raised when such long running operations are going on? That way, even the dialog might not be needed.
(from redmine: issue id 3563, created on 2018-10-26, closed on 2020-10-27)