The GitHub Actions job "SqlServer Integration Tests" on 
pekko-persistence-jdbc.git/complete-journal-write-queue has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
3732d983067b22e2a912cbb4d8baa857461ca2da / PJ Fanning 
<[email protected]>
Complete the journal write queue when the plugin actor stops

Motivation:
`BaseDao` materializes a stream in its constructor, fed by a 
`BoundedSourceQueue`
that batches journal row writes. The queue is never completed, so the stream
stays materialized for as long as the actor system lives. A new dao, and with it
a new stream, is created every time the journal plugin actor starts, so every
restart of that actor strands the stream of the previous incarnation.

`JdbcAsyncWriteJournal.postStop` already closes the database it owns, but left
the write queue running.

Modification:
Added `BaseDao.completeWriteQueue()` (internal API) and called it from
`JdbcAsyncWriteJournal.postStop` before the database is closed. Both the default
and the legacy journal dao extend `BaseDao`, so both are covered.

Result:
The write stream of a journal dao terminates when the plugin actor that owns it
stops.

Tests:
- sbt "core/testOnly org.apache.pekko.persistence.jdbc.journal.dao.BaseDaoSpec 
org.apache.pekko.persistence.jdbc.journal.JdbcAsyncWriteJournalShutdownTest" - 
passed; the shutdown test fails without the postStop change
- sbt "core/test" - 292 passed, 1 failed: H2ScalaCurrentEventsByTagTest "should 
complete without any gaps in case events are being persisted when the query is 
executed", which fails the same way on an unmodified checkout of main on this 
machine
- sbt "core/mimaReportBinaryIssues" - passed
- scalafmt --mode diff-ref=upstream/main - no changes

References:
None - found while reviewing the main sources for resource leaks

Report URL: 
https://github.com/apache/pekko-persistence-jdbc/actions/runs/34063136072

With regards,
GitHub Actions via GitBox


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

Reply via email to