Skip to content
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

Fix for bug #463042 #425

Closed
wants to merge 3 commits into from
Closed

Conversation

patrickmhaller
Copy link

by avoiding sharing the ListExpressionOperator
instance between threads. This is achieved by
cloning the operator instance in
ArgumentListFunctionExpression.postCopyIn().

Before, getDatabaseStrings() and parallel modifications to
numberOfItems were clashing.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=463042

Change-Id: Ia2e29da74797494394d0323dcc5ded501d72b433
Signed-off-by: Patrick Haller patrick.haller@sap.com

by avoiding sharing the ListExpressionOperator
instance between threads. This is achieved by
cloning the operator instance in
ArgumentListFunctionExpression.postCopyIn().

Before, getDatabaseStrings() and parallel modifications to
numberOfItems were clashing.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=463042

Change-Id: Ia2e29da74797494394d0323dcc5ded501d72b433
Signed-off-by: Patrick Haller <patrick.haller@sap.com>
to satisfy @OverRide annotation.

Change-Id: I79678e6a132c4638bf7447da5c5e9aa8521a10e2
Signed-off-by: Patrick Haller <patrick.haller@sap.com>
.. to its former state. This restores unit tests in
TestCaseQuery.


Change-Id: I63abadaa6d4da82c4e697a03f94e7f4e9c7ace24
Signed-off-by: Patrick Haller <patrick.haller@sap.com>
@patrickmhaller
Copy link
Author

Ping on the pull request. Please include in an upcoming release.

@patrickmhaller patrickmhaller marked this pull request as draft January 12, 2021 17:18
@patrickmhaller patrickmhaller marked this pull request as ready for review January 12, 2021 17:18
@patrickmhaller patrickmhaller marked this pull request as draft January 12, 2021 17:19
@patrickmhaller patrickmhaller marked this pull request as ready for review January 12, 2021 17:20
@patrickmhaller
Copy link
Author

@rdicroce and @lukasj Hi - I got stuck with getting this PR included in an Eclipselink release. Could you kindly got a look? Thank you.

@rdicroce
Copy link
Contributor

@patrickmhaller I can't actually do anything here since I'm not a committer. I've just submitted a few patches here and there; in fact I have a PR myself that's been languishing for almost 2 years now (#427). But I noticed the whole codebase was reorganized in master branch to Mavenize the build process, so your patch probably needs to be updated.

@rfelcman
Copy link
Contributor

Sorry, but currently I see there two blockers for this PR

  1. Please rebase Your git branch against latest (HEAD) master branch. As @rdicroce mentioned above there was project build transformation from Ant to Maven build system -> sources was moved to another location.
  2. I'm missing unit test there. For functional changes/fixes is common practice attach some unit test too. Something similar like test case from https://bugs.eclipse.org/bugs/show_bug.cgi?id=463042 should be fine. Test location should be https://github.com/eclipse-ee4j/eclipselink/tree/master/jpa/eclipselink.jpa.test.jse/src/it/java/org/eclipse/persistence/jpa/test/ + <something> and for test structure check other tests in location e.g. https://github.com/eclipse-ee4j/eclipselink/tree/master/jpa/eclipselink.jpa.test.jse/src/it/java/org/eclipse/persistence/jpa/test

@patrickmhaller
Copy link
Author

@rfelcman First, thanks for looking into this.

In regards to unit test, as described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=463042, this is a multi-threading problem.
We used to observe generation of broken SQL in production systems with a certain load. Since this patch was applied, the problems were gone.
Any good idea how to elegantly prove via unit test the correctness of the patch? I'm afraid that multi-threading unit tests are often unreliable and long-running to give enough window of opportunity (and would just prove the EclipseLink code was broken before).
I'd much appreciate if you could kindly read through the issue and review the patch, if possible.

I will try to look into rebasing onto HEAD but it'll me take some time.

@dazey3
Copy link
Contributor

dazey3 commented Nov 11, 2021

I think a more comprehensive fix for this issue (specifically for master) would be to remove the numberOfItems state from ListExpressionOperator. IMO ExpressionOperators should not track any state and should be shared around. I think this fix is better for patching older releases since we cannot/should not alter existing API there and we should preserve existing behavior, but for master, I would like to see state removed and a new strategy implemented instead.

@patrickmhaller
I opened #1354 and created PRs against 2.6_WAS, 2.7, 3.0, and master. I also added your details to the commits for the service branches as you did isolate where that fix can be implemented. Thanks for the assistance on this!

@dazey3 dazey3 closed this Nov 11, 2021
@patrickmhaller
Copy link
Author

Thanks a lot for taking care of this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants