-
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
SwaggerUiProcessor leaves behind non-empty temporary directories in dev mode #12577
Comments
/cc @phillip-kruger |
Thanks @famod . |
We probably need a shutdown hook to remove the temp directory. Not sure it will fix the issue for ungraceful shutdown though. |
Let's try to fix this one for 1.9.0.Final. It's not pretty. |
@famod - still trying to recreate this, seems to work perfect on fedora: |
@phillip-kruger |
I used peek (https://github.com/phw/peek)
I found a old Windows 7 DVD, busy installing on a vm, I want to see if I can recreate it there. That should rule out/in fedora auto cleanup |
I'll try to run |
Manual run on your CI server is a good idea. I am also download CentOS 7 to try it out there. |
I just realized that this is more elaborate than I first thought because the SSH shell is not set up for So instead I ran
|
Btw, this is how our CI is terminating the dev mode instances which should be equivalent to CTRL+C:
PS: |
Ha! The plot thickens: I was able to start a dev mode instance manually on CentOS7 and it does not leave behind a folder after CTRL+C! The difference I can see now is that with the above the usual shutdown message is printed:
I cannot find this message in our regular CI logs. This leads me to the assumption that we mistakenly kill those instances forcefully. I think this has something to do with So false alarm for Linux I would say (unless you see a chance to clean up for ungraceful shutdown)! And guess what? The message is also missing on Windows, but for CTRL+C. Thanks a lot for your support so far, @phillip-kruger! |
No worries @famod - happy to help, we need to get to the bottom of this. I am also still looking on my side to try and recreate this. So during your build you do a mvn quarkus:dev ? From another mvn process ?? Can you give me more details on how you run the dev mode test ? That might help in recreating it. Thanks :) |
@famod - I recreated it on Windows ! Let me see if I can fix that, and then we test that fix against your CI server. |
The unfiltered truth 😉 :
I don't think any of those parameters are relevant for this specific problem. The <profile>
<id>qdev</id>
<properties>
<enforcer.skip>true</enforcer.skip>
<asciidoctor.skip>true</asciidoctor.skip>
<skipTests>true</skipTests>
<spotbugs.skip>true</spotbugs.skip>
<quarkus.prepare.skip>true</quarkus.prepare.skip>
</properties>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
</dependency>
</dependencies>
<build>
<defaultGoal>quarkus:dev</defaultGoal>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<configuration>
<!-- note: processTag is used on Jenkins but it does no harm locally (if set to some value) -->
<jvmArgs>-DprocessTag=${processTag}</jvmArgs>
<!-- we want to use devmode in modules that are not "built" as quarkus apps -->
<enforceBuildGoal>false</enforceBuildGoal>
</configuration>
</plugin>
</plugins>
</build>
</profile> so in the end this is just |
Ok, so two colleagues double-checked this on their Windows 10 machines and for no setup dev mode was terminated gracefully:
|
So the code use a shutdown hook to delete the folder: From the Javadoc:
I am still investigating other options |
Ah, you're right. It's just not directly obvious since the hook is operating on
Well, first and foremost it would be a good improvement if Quarkus dev mode would terminate gracefully upon CTRL+C on Windows. |
Agree. For me it's not consistent. Sometimes it actually do remove the directory. Weird. |
Do you see the shutdown message in these cases? |
Yes I do. - *Edit - No I don't. At least not anymore. Maybe I remember incorrectly. It does however works fine in Netbeans. And seems like When you do |
Describe the bug
If swagger-ui extension is active, each app start creates a
quarkus-swagger-ui_*
folder in/tmp
, e.g.quarkus-swagger-ui_31789176944326801422565934992530930
, containing all the webjar files:Such folders are not removed when the app is terminated (even not when terminated gracefully), filling up
/tmp
.Expected behavior
Nothing should be left behind after the Quarkus app terminated.
Actual behavior
/tmp
is "spammed" until all space is depleted.To Reproduce
Steps to reproduce the behavior:
/tmp
Configuration
Not relevant.
Environment (please complete the following information):
uname -a
orver
:MINGW64_NT-10.0-18363 XXX 3.0.7-338.x86_64 2019-11-21 23:07 UTC x86_64 Msys
java -version
:OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
1.8.0.Final
mvnw --version
orgradlew --version
):Apache Maven 3.6.3
Additional context
See also: https://stackoverflow.com/questions/15022219/does-files-createtempdirectory-remove-the-directory-after-jvm-exits-normally
These processors are also affected:
SmallRyeHealthProcessor
SmallRyeGraphQLProcessor
Other potentially affected, non-processor classes are mentioned here: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Various.20temp.20dirs.20are.20not.20cleaned.20up.3F/near/212540339
I'm also wondering wether this:
could be more something like
"quarkus-swagger-ui_" + artifact.getVersion()
?This would require something like
java.nio.channels.FileLock
though.The text was updated successfully, but these errors were encountered: