Skip to content

#2401 - Per-project log should be removed when project is deleted#6017

Merged
reckart merged 1 commit into
release/40.xfrom
bugfix/2401-Per-project-log-should-be-removed-when-project-is-deleted
May 8, 2026
Merged

#2401 - Per-project log should be removed when project is deleted#6017
reckart merged 1 commit into
release/40.xfrom
bugfix/2401-Per-project-log-should-be-removed-when-project-is-deleted

Conversation

@reckart
Copy link
Copy Markdown
Member

@reckart reckart commented May 8, 2026

What's in the PR

  • 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

How to test manually

  • Delete a project
  • Check if its log file is gone

Automatic testing

  • PR includes unit tests

Documentation

  • PR updates documentation

@reckart reckart added this to the 40.4 milestone May 8, 2026
@reckart reckart self-assigned this May 8, 2026
@reckart reckart added the 🐛 Bug Something isn't working label May 8, 2026
@reckart reckart added this to Kanban May 8, 2026
@github-project-automation github-project-automation Bot moved this to 🔖 To do in Kanban May 8, 2026
@reckart reckart requested a review from Copilot May 8, 2026 17:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
@reckart reckart force-pushed the bugfix/2401-Per-project-log-should-be-removed-when-project-is-deleted branch from 4eceaba to c682982 Compare May 8, 2026 18:00
@reckart reckart requested a review from Copilot May 8, 2026 18:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@reckart reckart merged commit 1090f7a into release/40.x May 8, 2026
8 checks passed
@reckart reckart deleted the bugfix/2401-Per-project-log-should-be-removed-when-project-is-deleted branch May 8, 2026 18:28
@github-project-automation github-project-automation Bot moved this from 🔖 To do to 🍹 Done in Kanban May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug Something isn't working

Projects

Status: 🍹 Done

Development

Successfully merging this pull request may close these issues.

2 participants