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
fix(RepositoryUpdater): make sure temp directories are deleted #2010
Merged
mpro7
merged 5 commits into
main
from
DEV-559-api-doesnt-cleanup-temp-folder-after-crash-at-startup
Mar 4, 2022
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
60c5ab1
fix(RepositoryUpdater): delete temp directories
mpro7 ba11afb
Merge branch 'main' into DEV-559-api-doesnt-cleanup-temp-folder-after…
mpro7 21626cb
review changes
mpro7 881cf90
remove unused code
mpro7 b5bfab3
Merge branch 'main' into DEV-559-api-doesnt-cleanup-temp-folder-after…
mpro7 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings.upgradeDownloadDir
. If this is set, then the temp directory might not betmp
. It is a valid setting that could be used in production.Paths.get()
to have a correct path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding that check doesn't make sense since that part of code is commented out and
settings.upgradeDownloadDir
in this check will always lead to None option, which goes then todeleteTempDirectories()
.Hmmm, is the
Paths.get()
suggestion because Windows uses backslashes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subotic I've removed unused code in 881cf90. I don't know why it was commented out, but if my implementation will not work, it can be brought back. That means maybe instead of creating random folders, only one would be used.
I've tried out
Paths.get()
andPath.of()
. Although all compiles,test-repository-upgrade
hangs on last scriptwait-for-knora.sh
. Once again, if this implementation somehow fail, idea described above, should make possible to use eitherPaths.get()
orPath.of()
.And
tmp
is default temp folder defined in docker-compose.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't merge a PR if the discussion is not finished.
The locally defined
docker-compose.yml
is irrelevant. The app is deployed in production with a different set of settings and anotherdocker-compose.yml
. Instead of adding 2 lines of code, you are now risking to break stuff in production. Not the right attitude in my opinion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but thought you are not going to reply and because already accepting this PR there isn't any critical issue here.
If you feel so, this changes could be reverted. But this isn't deployed directly to the production, we have TEST and STAGE too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked PROD configuration and apparently
/tmp:/tmp
volume is also defined indocker-compose.yml
,/tmp/
folder exists and containsknora*
update directories to remove.