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

Ensure that no-isolation workers run with the classloader of the submitting thread #10335

Merged
merged 4 commits into from Aug 22, 2019

Conversation

ghale
Copy link
Member

@ghale ghale commented Aug 21, 2019

This fixes a problem where, in a composite build, a worker can get a context
classloader set to a classloader from another project, which causes a class
mismatch when we attempt to re-hydrate a legacy runnable class in AdapterWorkAction.

We now ensure that the context classloader for no-isolation workers get set
to the context classloader of the thread that submitted the work.

Fixes #10317

…itting thread

This fixes a problem where, in a composite build, a worker can get a context
classloader set to a classloader from another project, which causes a class
mismatch when we attempt to re-hydrate a legacy runnable class in AdapterWorkAction.

We now ensure that the context classloader for no-isolation workers get set
to the context classloader of the thread that submitted the work.
@ghale ghale added this to the 5.6.1 milestone Aug 21, 2019
@ghale ghale requested a review from big-guy August 21, 2019 20:40
@ghale ghale self-assigned this Aug 21, 2019
def "can use worker api with composite builds using #pluginId"() {
settingsFile << """
includeBuild "plugin"
includeBuild "build1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use a better name for build1? this looks like it's some kind of empty dependency for the root project. Maybe just "dependency"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough - I've changed the project names to "app" and "lib".

}

dependencies {
classpath "org.apache.commons:commons-math:2.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary to trigger the breakage? If so, could you put a comment explaining how this is important?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary since classloader caching would cause an identical classpath to be returned for both builds unless there is some difference. However, it's not necessary that it actually be a real dependency. I've changed this to just an un-managed file and eliminated the external dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug @core Issue owned by GBT Core in:workers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants