The GitHub Actions job "Basic checks" on 
pekko-projection.git/filterstage-cancel-replay has succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
1fe46b4761e773d147949bb094816be8ed1bbf9f / PJ Fanning 
<[email protected]>
cancel in-progress replay streams when FilterStage stops

Motivation:
`FilterStage` materialises a `currentEventsByPersistenceIdTyped` query per
replay with `Sink.queue()` and keeps it in `replayInProgress`. The queue is only
cancelled when a replay is replaced by a newer replay for the same
persistenceId. There is no `postStop`, so when the stage completes or fails
(`failStage` from the replay callback, or the consumer cancelling the gRPC
stream) every replay still in progress - up to `replayParallelism` per stream -
stays materialised with an un-pulled `SinkQueue`, keeping the query stream and
the resources it holds, such as a database connection, alive indefinitely.

Modification:
Cancel the queues of all replays still in `replayInProgress` in `postStop`.

Result:
Replay streams are cancelled when the stage stops, instead of being leaked.

Tests:
- New FilterStageSpec case "cancel replay streams that are still in progress 
when stopped", fails without the fix
- sbt "grpc-test/Test/testOnly *FilterStageSpec" - 9 passed
- sbt checkCodeStyle - success
- MiMa not run - MimaPlugin is disabled for the grpc module in build.sbt

References:
None - found during a resource-leak audit of the main sources

Report URL: https://github.com/apache/pekko-projection/actions/runs/40474951380

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to