pjfanning opened a new pull request, #494: URL: https://github.com/apache/pekko-persistence-cassandra/pull/494
### Motivation `EventsByTagMigration` starts a top level tag writers actor in its constructor and offers no way to stop it, so the actor and its `TagWriter` children stay alive for the lifetime of the `ActorSystem` after the migration has finished. The actor was also anonymous (`/user/$a`), which makes it hard to identify in logs. ### Modification - Give the tag writers actor a stable name, in the same style as the one `Reconciliation` starts, using a counter so that several instances can coexist. - Add `EventsByTagMigration.close()` to stop it, and document it on the class. ### Result Callers can release the actor once the migration has completed, and the actor is recognisable in logs and actor paths. `close()` is idempotent. ### Tests - `sbt "core/Test/testOnly org.apache.pekko.persistence.cassandra.EventsByTagMigrationCloseSpec"` — passed. New spec, asserts the tag writers actor terminates on `close()` and that closing twice is safe. Needs no Cassandra. - `sbt "core/mimaReportBinaryIssues"` — passed. - `scalafmt --mode diff-ref=upstream/main --list` — no changes needed. - `git diff --check` — clean. - `sbt "core/Test/testOnly org.apache.pekko.persistence.cassandra.EventsByTagMigrationSpec"` — aborted with `AllNodesFailedException`, no local Cassandra (docker not running). Same abort on an unmodified checkout. ### References None - resource leak found while auditing actor and session lifecycles. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
