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

wait before error quit #269

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

wait before error quit #269

wants to merge 3 commits into from

Conversation

yishi-ttd
Copy link
Contributor

@yishi-ttd yishi-ttd commented Nov 2, 2023

Wait a bit before error quit during bootstrap. Allow error log to be flushed to logs.

((LoggerContext)org.slf4j.LoggerFactory.getILoggerFactory()).stop(); actually does not work - it depends on OS buffer implementation.

This is a known issue: https://jira.qos.ch/browse/LOGBACK-735

Without this fix we will see weird log truncation in GCP. The real exception will not be logged - not friendly for touble shooting.

image

// allow log to be flushed before quit app.
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth catching all exceptions here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@yishi-ttd yishi-ttd requested a review from thomasm-ttd November 3, 2023 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants