-
Notifications
You must be signed in to change notification settings - Fork 228
AbstractDocument fix concurrency issues (BadPositionCategoryException) #2676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AbstractDocument fix concurrency issues (BadPositionCategoryException) #2676
Conversation
|
i wonder if adding "synchronized" to the method is an API change as there is an error if overwriting methods do not add "synchronized" too |
9f50793 to
df49968
Compare
df49968 to
41fbd02
Compare
There is SynchronizableDocument. I believe AbstractDocument was supposed not to be synchronized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks wrong to synchronize on the document that then potentially uses a lock object.
If synchronization is required, the lock object is needed to be set.
Also see comment here I think it is better solved on the consumer side:
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
bundles/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
Show resolved
Hide resolved
|
What do you suggest? Checking all usages seem to be impossible by the shear amount of usages. |
Test Results 1 818 files ±0 1 818 suites ±0 1h 34m 22s ⏱️ - 4m 20s For more details on these failures, see this check. Results for commit 4660e33. ± Comparison against base commit e3382fc. ♻️ This comment has been updated with latest results. |
See https://github.com/eclipse-platform/eclipse.platform/blob/master/docs/Evolving-Java-based-APIs-2.md
@jukzi : I'm not sure it is a good idea to change behavior of the basic class for documents with multiple inheritance, I see at least two clients that had extra synchronization enabled - SynchronizableDocument and XtextDocument. @szarnekow : FYI. XtextDocument uses own locking too. |
Adds missing synchronized overrides of underlying AbstractDocument To synchronize all accesses to AbstractDocument.fEndPositions especially by addPositionCategory() eclipse-jdt/eclipse.jdt.ui#1067
5a95ff9 to
802c967
Compare
|
I changed the commit to only synchronize SynchronizableDocument where needed/missing |
laeubi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me
|
Thanks, looks not so scary anymore. |
|
ignoring random fail #1517 |
Thanks for the ping. I was already reading the MR and it looks quite good. Nice catch @jukzi |
By synchronized access to members used from different thread
eclipse-jdt/eclipse.jdt.ui#1067