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

Restructure vertx-cache to allow multiple applications with launched by multiple users #15541

Merged
merged 3 commits into from Mar 10, 2021

Conversation

cescoffier
Copy link
Member

Create /tmp/vertx-cache and configure it to be world-readable and writable.
Under that directory, another random directory is created that is only readable and writable from the current user (which is used by the application)).

The vertx-cache directory creation is disabled if:

  • the user specifies a cache directory
  • the vertx-cache directory already exists

Fix #7678

…table.

Under that directory, another random directory is created that is only readable and writable from the current user.

The vertx-cache directory creation is disabled if:

* the user specifies a cache directory
* the vertx-cache directory already exists

Fix quarkusio#7678
@cescoffier cescoffier requested a review from rsvoboda March 8, 2021 14:26
@cescoffier cescoffier added the kind/enhancement New feature or request label Mar 8, 2021
Copy link
Member

@rsvoboda rsvoboda left a comment

Choose a reason for hiding this comment

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

Tried on macOS and on Windows, in both JVM and Native mode. Using GraalVM 20.0.0.2 JDK 11 based.

Directory listing from Windows:

 Directory of c:\Users\Rostislav\AppData\Local\Temp\vertx-cache

08.03.2021  19:39    <DIR>          .
08.03.2021  19:39    <DIR>          ..
08.03.2021  19:39    <DIR>          -1470934000943740825
08.03.2021  18:18    <DIR>          -3024270797316995263
08.03.2021  18:53    <DIR>          -3474816208713856604
08.03.2021  18:53    <DIR>          -4254873161419174401
08.03.2021  19:39    <DIR>          -6232826564929696508
08.03.2021  19:39    <DIR>          1012173164788925745
08.03.2021  18:17    <DIR>          1716656712433746412
08.03.2021  18:17    <DIR>          3517666954089023773
08.03.2021  18:16    <DIR>          7645099081770877049
08.03.2021  18:53    <DIR>          7893496767166432346
08.03.2021  18:51    <DIR>          8969940024877338545

The only concern I have is the set of empty directories under vertx-cache.
Can be something done about it or it is up to system admins to make sure tmp is cleaned / container is thrown away?

@cescoffier
Copy link
Member Author

@rsvoboda The previous approach was not deleting the directory either, but I agree, better cleaning if we have created the directory. We won't clean if it's a directory set by the user (because it would reuse it during the next execution, and so would allow avoiding copying files over).

@rsvoboda
Copy link
Member

rsvoboda commented Mar 9, 2021

Agree, I will file new GH issue for directory removal.

GH issue: #15566

@cescoffier
Copy link
Member Author

@rsvoboda I updated the PR to clean up the directory on shutdown.

@gsmet
Copy link
Member

gsmet commented Mar 9, 2021

Any chance we could avoid negative numbers as directory names? It's a bit weird to have the directory starting with -.

It's a detail, we can live with it but if there's an easy fix...

@cescoffier cescoffier linked an issue Mar 9, 2021 that may be closed by this pull request
@cescoffier
Copy link
Member Author

Yes, I can make sure the random is positive. Let me fix that.

* make sure it does not exist
* avoid negative numbers
@cescoffier
Copy link
Member Author

@gsmet I used my awesome mathematic background to avoid negative numbers.

@rsvoboda
Copy link
Member

rsvoboda commented Mar 9, 2021

I have checked new addition on both Windows and macOS and it works nicely, both JVM and native mode.
Thanks for the update to include fix for #15566.

@cescoffier cescoffier merged commit eb98535 into quarkusio:master Mar 10, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 10, 2021
@cescoffier cescoffier deleted the vertx-cache-wolrd-writable branch March 10, 2021 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertx kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup of vertx-cache temporary directories Quarkus boot fails when vertx-cache temporary directory exists
3 participants