-
Notifications
You must be signed in to change notification settings - Fork 79
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
Blackbird fails with LinkageError when the same class is used across two separate classloaders #169
Comments
Experienced exactly the same 👍 This "lookup and define" operation should probably be synchronized at some point (maybe a lookup cache is needed to avoid performance penalty):
|
can confirm we're seeing this with the same classloader being used, just a race condition between the lookup and define when running tests in parallel. Is there a workaround beyond disabling the Blackbird module? |
Hi @josephlbarnett You could downgrade to the previous version or override this problematic class in your application's class path (by correctly implementing the lookup and define). |
Bumps `version.dropwizard` from 2.0.29 to 2.1.0. Updates `dropwizard-core` from 2.0.29 to 2.1.0 Updates `dropwizard-configuration` from 2.0.29 to 2.1.0 Updates `dropwizard-auth` from 2.0.29 to 2.1.0 Updates `dropwizard-metrics` from 2.0.29 to 2.1.0 Updates `dropwizard-jersey` from 2.0.29 to 2.1.0 Updates `dropwizard-jackson` from 2.0.29 to 2.1.0 * Avoid registering blackbird module due to race condition bug: FasterXML/jackson-modules-base#169 Updates `dropwizard-jetty` from 2.0.29 to 2.1.0 Updates `dropwizard-logging` from 2.0.29 to 2.1.0 Updates `dropwizard-request-logging` from 2.0.29 to 2.1.0 Updates `dropwizard-servlets` from 2.0.29 to 2.1.0 Updates `dropwizard-testing` from 2.0.29 to 2.1.0 Updates `dropwizard-validation` from 2.0.29 to 2.1.0 --- updated-dependencies: - dependency-name: io.dropwizard:dropwizard-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-configuration dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-auth dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-metrics dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-jersey dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-jackson dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-jetty dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-logging dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-request-logging dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-servlets dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-testing dependency-type: direct:development update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-validation dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
If blackbird attempts to access/define a new class concurrently, it can hit a race condition between attempting to access it and defining it when that fails. If it does fail, enter a synchronized block and try again before defining the access class. Should fix FasterXML#169
If blackbird attempts to access/define a new class concurrently, it can hit a race condition between attempting to access it and defining it when that fails. If it does fail, enter a synchronized block and try again before defining the access class. Should fix FasterXML#169
If blackbird attempts to access/define a new class concurrently, it can hit a race condition between attempting to access it and defining it when that fails. If it does fail, enter a synchronized block and try again before defining the access class. Should fix FasterXML#169
Bumps `version.dropwizard` from 2.0.29 to 2.1.0. Updates `dropwizard-core` from 2.0.29 to 2.1.0 Updates `dropwizard-configuration` from 2.0.29 to 2.1.0 Updates `dropwizard-auth` from 2.0.29 to 2.1.0 Updates `dropwizard-metrics` from 2.0.29 to 2.1.0 Updates `dropwizard-jersey` from 2.0.29 to 2.1.0 Updates `dropwizard-jackson` from 2.0.29 to 2.1.0 * Avoid registering blackbird module due to race condition bug: FasterXML/jackson-modules-base#169 Updates `dropwizard-jetty` from 2.0.29 to 2.1.0 Updates `dropwizard-logging` from 2.0.29 to 2.1.0 Updates `dropwizard-request-logging` from 2.0.29 to 2.1.0 Updates `dropwizard-servlets` from 2.0.29 to 2.1.0 Updates `dropwizard-testing` from 2.0.29 to 2.1.0 Updates `dropwizard-validation` from 2.0.29 to 2.1.0 --- updated-dependencies: - dependency-name: io.dropwizard:dropwizard-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-configuration dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-auth dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-metrics dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-jersey dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-jackson dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-jetty dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-logging dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-request-logging dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-servlets dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-testing dependency-type: direct:development update-type: version-update:semver-minor - dependency-name: io.dropwizard:dropwizard-validation dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
The new Blackbird module has an issue when it is used to serialise the same class, but across two separate classloaders.
eg. we are serialising class a.b.c from an ObjectMapper that is configured to use Blackbird, from within a library. CrossLoader access does it's thing, and:
Next, we attempt to deserialise from an ObjectMapper that is configured to use Blackbird, but from within the main application. The classloader is different. CrossLoader again attempts to do it's thing, and:
Seems to me like your classname - JacksonBlackbirdAccess - cannot be static, but must include an object reference to the current classloader? ie. allow each copy of JacksonBlackbird CrossLoader to have it's own separate definition of your helper class.
an example stacktrace:
The text was updated successfully, but these errors were encountered: