-
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
Regression in ConversionService for concurrent application contexts #7948
Comments
Which particular converter from |
this test case uses compositeByteBufCharSequenceTypeConverter |
Those don't rely on the bean context and can be extracted to an additional |
that seems like a good workaround for 3.6, I will make a PR. thanks! |
Move some converters from NettyConverters into a new converter registrar that does not require further dependencies from the application context. This allows the registrar to be loaded into the default conversion service with no app context present. This is a workaround for #7948, and fixes micronaut-projects/micronaut-aws#1452 .
* Move some netty converters to SPI Move some converters from NettyConverters into a new converter registrar that does not require further dependencies from the application context. This allows the registrar to be loaded into the default conversion service with no app context present. This is a workaround for #7948, and fixes micronaut-projects/micronaut-aws#1452 . * move httpdata converters as well * unused import
What is the actual workaround here? I've tried to inject
|
@musketyr that does not seem related to this issue? |
@yawkat the stack trace is very similar to what has been stated in original issue micronaut-projects/micronaut-serialization#237
and it's also triggered by when
or am I missing something? I'm trying to create a reproducer outside of our project but no luck so far. |
usually this is because you are interacting with a context that has been shutdown already |
Ok, I think I have found the source of the issue even it's not clear to me what are the consequences which causes the exception above. I have found a couple of misconfigured Micronaut Worker jobs which are throwing exceptions from the |
this will hopefully be less confusing in 4.x |
Issue description
#7635 changed the
ConversionService.DEFAULT
to be reset when an application context is closed. This breaks non-standard conversions (e.g.NettyConverters
) when there are concurrent application contexts:@dstepanov mentioned that we should probably fix this in 4.0, but we may need to do this earlier. In particular, this issue lead to a test failure in the aws module: micronaut-projects/micronaut-aws#1452 – the application context for one test was closed late, leading to the conversion service for another test being improperly reset.
I'm not sure of the path forward here. We could revert #7635, but I'm not sure if this regression is worse than the bug that was fixed in that PR. We could also move forward with @dstepanov suggestion of a "wrapping" conversion service for each context, which is the proper way to do this, but I'm not sure if uncoupling the context conversion service would lead to other issues that need a major release.
The text was updated successfully, but these errors were encountered: