Skip to content

Fix inPurge race condition and housekeeping timestamp-on-success semantics#2959

Merged
tastybento merged 2 commits intodevelopfrom
copilot/sub-pr-2945
Apr 26, 2026
Merged

Fix inPurge race condition and housekeeping timestamp-on-success semantics#2959
tastybento merged 2 commits intodevelopfrom
copilot/sub-pr-2945

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

Three correctness issues flagged in PR review: deleteEverything() left inPurge unset during async deletion (allowing concurrent purges), housekeeping cycles advanced their last-run timestamp unconditionally even on error, and the class Javadoc described a non-existent single housekeeping.enabled gate.

Changes

  • AbstractPurgeCommand.deleteEverything() — Set inPurge = true before dispatching the async delete. Clear it in the main-thread callback's finally block (covers both success and failure paths), and in a catch (RuntimeException) guard for synchronous exceptions before the task is dispatched.

  • HousekeepingManager.runDeleteIfNonEmpty() — Returns -1 on delete error (previously 0, indistinguishable from "nothing to purge").

  • HousekeepingManager.executeAgeCycle() / executeDeletedCycle() — Track boolean hasErrors across all worlds; only advance lastAgeRunMillis / lastDeletedRunMillis and persist state when the full cycle completes error-free. Logs an explicit error and leaves the timestamp unchanged on partial failure so the scheduler retries.

  • HousekeepingManager Javadoc — Replaced the incorrect housekeeping.enabled flag reference with accurate references to Settings#isHousekeepingAgeEnabled() and Settings#isHousekeepingDeletedEnabled().

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 26, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.momirealms.net
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Release 3.15.0 Fix inPurge race condition and housekeeping timestamp-on-success semantics Apr 26, 2026
Copilot AI requested a review from tastybento April 26, 2026 20:06
@tastybento tastybento marked this pull request as ready for review April 26, 2026 20:14
@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit 4028f61 into develop Apr 26, 2026
3 checks passed
@tastybento tastybento deleted the copilot/sub-pr-2945 branch April 26, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants