Skip to content

paused: set AutoInactiveDestroy => 1 on DBI handle - #603

Merged
rspier merged 1 commit into
andk:masterfrom
rspier:aid
Dec 4, 2026
Merged

rspier merged 1 commit into
andk:masterfrom
rspier:aid

Conversation

@rspier

@rspier rspier commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

paused::loop() connects to the database without AutoInactiveDestroy and then forks child processes via Parallel::Runner to run mldistwatch using system(). When a forked child finishes system() and exits, Perl's global destruction runs DESTROY on the inherited DBI handle, sending COM_QUIT to MariaDB over the shared socket file descriptor and closing the parent's connection.

Any subsequent writeback() in the parent during that loop() iteration fails with 'Server has gone away' when updating dverified or dgot on uris. On multi-file batches, once the first mldistwatch child exits, every remaining record in that pass fails to update uris and is re-selected and re-processed on the next loop() iteration, causing sustained retry storms.

Setting AutoInactiveDestroy => 1 in DBI->connect() prevents forked child processes from destroying or closing the parent's database connection on exit.

paused::loop() connects to the database without AutoInactiveDestroy and then forks child processes via Parallel::Runner to run mldistwatch using system(). When a forked child finishes system() and exits, Perl's global destruction runs DESTROY on the inherited DBI handle, sending COM_QUIT to MariaDB over the shared socket file descriptor and closing the parent's connection.

Any subsequent writeback() in the parent during that loop() iteration fails with 'Server has gone away' when updating dverified or dgot on uris. On multi-file batches, once the first mldistwatch child exits, every remaining record in that pass fails to update uris and is re-selected and re-processed on the next loop() iteration, causing sustained retry storms.

Setting AutoInactiveDestroy => 1 in DBI->connect() prevents forked child processes from destroying or closing the parent's database connection on exit.
@rspier
rspier merged commit 3c7bb2a into andk:master Dec 4, 2026
1 check passed
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