-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Reset shared ConversionService
instance state on context restart
#7635
Conversation
can you fix the test failures? Seem tests relied on this previously present shared state. |
cf89e99
to
705c6cf
Compare
Targeting 3.6 |
core/src/main/java/io/micronaut/core/convert/DefaultConversionService.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/micronaut/core/convert/DefaultConversionService.java
Outdated
Show resolved
Hide resolved
@@ -37,6 +38,7 @@ class DefaultAllocatorSpec extends Specification { | |||
'maxCachedByteBuffersPerChunk' | 20 | |||
} | |||
|
|||
@Ignore |
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.
if this reliably fails now, maybe your change caused the allocator class that reads the system property to load before the config is applied. this needs to be fixed
can you explain why this change is necessary and related to the serialization issue? what kind of state is the shared conversion context carrying that needs to be reset? |
We register convertors into the static instance which is shared across bean contexts. The problem arises when the convertor was registered with an instance of the bean context, that convertor will fail when accessed after the bean context is destroyed. |
ah, makes sense. a bit weird though to register to a shared conversion context from a bean context that isnt shared... |
We should change it probably in 4.0. Shared |
It looks like custom |
is it called in a static initializer? in that case you cant use multithreading at all without risking deadlocks |
Yep, going to remove forking |
Kudos, SonarCloud Quality Gate passed! |
Still failing on Java 17 :( |
I did restart and it passed :-/ |
Fixes micronaut-projects/micronaut-serialization#237