-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Thread locked with optimize-contexts and @Startup bean #38040
Comments
@mkouba could you check it's the same issue that you already solved or if it's different? |
I can confirm that it's the same kind of problem and I've just verified that #37982 fixed this problem. In this particular case, an external service is called in the bean constructor (the rest client offloads the execution to a different thread ) which has the same effect as if it was called in a |
@lucaspouzac another workaround is to use a @ApplicationScoped
public class BootService {
private final ConfigService configService;
@Inject
public BootService(@RestClient ConfigService configService) {
this.configService = configService;
}
@Startup
void onStart() {
// Sync for startup
updateCache().await().atMost(Duration.ofSeconds(1));
}
Uni<Void> updateCache() {
return configService.getConfiguration().chain(item -> Uni.createFrom().voidItem());
}
} |
- fixes quarkusio#37958 and quarkusio#38040 - use a separate lock for each bean in the generated ContextInstances - replace ContextInstances#forEach() and ContextInstances#clear() with ContextInstances#removeEach() - optimize the generated ContextInstances to significantly reduce the size of the generated bytecode
- fixes quarkusio#37958 and quarkusio#38040 - use a separate lock for each bean in the generated ContextInstances - replace ContextInstances#forEach() and ContextInstances#clear() with ContextInstances#removeEach() - optimize the generated ContextInstances to significantly reduce the size of the generated bytecode
Describe the bug
Since migration to quarkus 3.6.x, our application don't startup because a thread is locked.
It's related to this feature : #36626
If we set
quarkus.arc.optimize-contexts=false
, the application start correctly.Expected behavior
If we set
quarkus.arc.optimize-contexts=true
, the application start correctly.Actual behavior
No response
How to Reproduce?
Attached, an application with 2 tests.
optimize-contexts.tar.gz
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: