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
8255980: G1 Service thread register_task can be used after shutdown #1093
Conversation
|
Since ServiceThread
is never deleted (as owned by G1CollectedHeap
) this sufficiently keeps alive the task queue so that the code can query it and the tasks in there.
Lgtm.
@kstefanj This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 32 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
G1RemSetSamplingTask* _remset_task; | ||
G1PeriodicGCTask* _periodic_gc_task; |
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.
I would prefer them being embedded directly, G1RemSetSamplingTask _remset_task;
, since they share the same lifespan with the enclosing object. No strong opinion; up to you.
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.
Me too, but then I would have to move the declaration of the tasks into the header. Now the above forward declaration is enough and I preferred that even more :)
/integrate |
@kstefanj Since your change was applied there have been 33 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 79b7909. |
Please review this change to improve the service thread task handling during shutdown.
This problem isn't currently visible, but with upcoming changes there is a race where tasks might be added to the service thread after it has been shut down. This becomes problematic because the task queue at that point consists of invalid objects. They are invalid because the tasks are currently stack-allocated on the service thread. This change both allocates the tasks handled by the service thread dynamically and add a check to avoid adding tasks when the service thread has been shut down. Just doing the dynamic allocation would be enough, but there is no reason to add tasks after the thread is shut down.
I've tested this fix together with my concurrent uncommit changes which highlight the problem, and also run tier1 and tier2 for sanity.
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1093/head:pull/1093
$ git checkout pull/1093