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 async console logging does not prevent failed startup errors #20695

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Oct 12, 2021

This is just a hack, the proper solution would probably be to introduce some state management into the AsyncHandler which would allow us to wait for it to drain it's queue and finish publishing all the records to its child handlers.

Nonetheless, this is way better than the current situation where the console logging is completely missing and users don't know whats wrong.

Fixes: #20660

@aaron-axisa
Copy link

Not sure if it might help, but AsyncHandler has a method (inherited from parent) #flush()
That might make sure all logs are printed rather than sleeping. Only theorising here as can't exactly test it atm.

@geoand
Copy link
Contributor Author

geoand commented Oct 12, 2021

That is not enough unfortunately. The issue is that the thread that takes records off the queue is a daemon thread and there is no way to interact with its lifecycle.

As I said above, this PR is a hack for the current state of things and a proper would involve updating AsyncHandler

@geoand geoand requested a review from gastaldi October 13, 2021 15:14
@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 13, 2021
@geoand geoand merged commit 269dea0 into quarkusio:main Oct 14, 2021
@quarkus-bot quarkus-bot bot added this to the 2.5 - main milestone Oct 14, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 14, 2021
@geoand geoand deleted the #20660 branch October 14, 2021 05:55
@aloubyansky aloubyansky modified the milestones: 2.5 - main, 2.4.0.Final Oct 18, 2021
@gsmet gsmet modified the milestones: 2.4.0.Final, 2.3.1.Final Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Logs when using async logs and have wrong config
5 participants