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

Add guard task to ensure log messages are dropped when the process isn't a Quarkus application #14386

Closed
wants to merge 1 commit into from

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jan 19, 2021

Fixes: #14295

This solution really sucks but I couldn't come up with anything better that

  1. Had no penalty for a prod run
  2. Worked properly for prod, dev and test mode

@ghost ghost added the area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins label Jan 19, 2021
@geoand geoand added area/logging triage/backport? and removed area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins labels Jan 19, 2021
@geoand
Copy link
Contributor Author

geoand commented Jan 19, 2021

The JDK 11 test failure is completely unrelated:

Error:    ConnectionPoolsClosedTest.connectionsFromOtherThreadsGetClosed:35 COM01003: Internal error: Assertion failure: Expected boolean value to be false
[INFO] 
Error:  Tests run: 2, Failures: 1, Errors: 0, Skipped: 0

It looks like there is some kind of race condition in the test

@gsmet
Copy link
Member

gsmet commented Jan 19, 2021

/cc @Sanne for the test failure above ^

@Sanne
Copy link
Member

Sanne commented Jan 19, 2021

hum thanks yes I can see a possible race. I'll open a different issue:

If this happens again while I haven't fixed it, feel free to disable the test.

Copy link
Member

@dmlloyd dmlloyd left a comment

Choose a reason for hiding this comment

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

Apologies, but: I think using a timer is a monumentally bad idea. Let's try to find some other approach - even examining the stack trace would be a better idea IMO.

Copy link
Member

@dmlloyd dmlloyd left a comment

Choose a reason for hiding this comment

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

Apologies, but: I think using a timer is a monumentally bad idea. Let's try to find some other approach - even examining the stack trace would be a better idea IMO.

@geoand
Copy link
Contributor Author

geoand commented Jan 19, 2021

I absolutely agree it's bad :).

If you think the stacktrace approach is better, then I'm all for it. I thought of it myself, but I didn't go through with it because I thought the performance penalty would be high...
Are you sure you want me to go ahead with it?

@dmlloyd
Copy link
Member

dmlloyd commented Jan 19, 2021

I absolutely agree it's bad :).

If you think the stacktrace approach is better, then I'm all for it. I thought of it myself, but I didn't go through with it because I thought the performance penalty would be high...
Are you sure you want me to go ahead with it?

I don't think it would be terrible. The main challenge is that the stack is not necessarily predictable; you'd have to do some experimentation to see.

@geoand
Copy link
Contributor Author

geoand commented Jan 19, 2021

I absolutely agree it's bad :).
If you think the stacktrace approach is better, then I'm all for it. I thought of it myself, but I didn't go through with it because I thought the performance penalty would be high...
Are you sure you want me to go ahead with it?

I don't think it would be terrible. The main challenge is that the stack is not necessarily predictable; you'd have to do some experimentation to see.

OK, I'll check

@geoand
Copy link
Contributor Author

geoand commented Jan 19, 2021

Another thing about the stack based approach, is that I am not sure that we'll be able to tell a Quarkus application is being run by examining the stack.

I am thinking about the case of tests where maven surefire launches a test jar and our logging is started very very early. In that case I think even when getHandlersOf there is a good chance that Quarkus bootstrapping will not have been started yet.

@geoand
Copy link
Contributor Author

geoand commented Jan 19, 2021

I also wanted to note that generating an InitialConfigurator won't work because again that class is engaged before Quarkus is even bootstraped in the case of tests

@Sanne
Copy link
Member

Sanne commented Jan 19, 2021

I've probably missed something, but why do we worry about "non-Quarkus applications" at all?

@geoand
Copy link
Contributor Author

geoand commented Jan 19, 2021

I've probably missed something, but why do we worry about "non-Quarkus applications" at all?

The problem is that merely the presence of Quarkus on the test classpath, leads to non Quarkus tests causing OOM errors because log messages get queued and never released

@stuartwdouglas
Copy link
Member

I don't know if there is any good automatic solution to this. Can't we just tell the user to specify -Djava.util.logging.manager=java.util.logging.LogManager and be done with it?

@geoand
Copy link
Contributor Author

geoand commented Jan 20, 2021

Yeah... The complexity of an acceptable solution outweighs the usefulness of addressing the issue.

@geoand geoand closed this Jan 20, 2021
@ghost ghost added the triage/invalid This doesn't seem right label Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java.lang.OutOfMemoryError: Java heap space - Quarkus 1.10.5.Final
5 participants