#2401 - Per-project log should be removed when project is deleted#6017
Merged
reckart merged 1 commit intoMay 8, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures that per-project log files are cleaned up when a project is deleted, and adjusts the deletion timing so log lines are no longer routed into a soon-to-be-deleted file. It also adds a unit test to validate the log-file cleanup behavior.
Changes:
- Capture the per-project log file path during project removal and delete it after the project-specific MDC context is closed (best-effort with warning on failure).
- Add a unit test verifying that removing a project removes its corresponding log file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| inception/inception-project/src/main/java/de/tudarmstadt/ukp/clarin/webanno/project/ProjectServiceImpl.java | Deletes the per-project log file after project removal and after MDC context closure, logging a warning if deletion fails. |
| inception/inception-project/src/test/java/de/tudarmstadt/ukp/clarin/webanno/project/ProjectServiceImplTest.java | Adds a test asserting that removeProject also removes the per-project log file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Delete per-project log file when removing a project - Move log file deletion after the logger MDC context is closed to avoid writing to a deleted file - Add best-effort deletion with a warning if the file cannot be removed (e.g. due to platform file handle retention) - Add test to verify that removing a project also deletes its log file
4eceaba to
c682982
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's in the PR
How to test manually
Automatic testing
Documentation