Skip to content

fix: failure in crash recovery in suggestion rematching - #1309

Merged
fricklerhandwerk merged 1 commit into
NixOS:mainfrom
fricklerhandwerk:fix-rematching
Sep 10, 2026
Merged

fricklerhandwerk merged 1 commit into
NixOS:mainfrom
fricklerhandwerk:fix-rematching

Conversation

@fricklerhandwerk

@fricklerhandwerk fricklerhandwerk commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

This one was really hard to figure out, because the logs weren't very informative and that particular process wasn't leaving a lot of traces in the database...

Due to how pgpubsub works, a listener would lock all notifications in the recovery phase on startup.
If it crashes, all notifications are put back to the queue, and only picked up again on next startup.
This would result in old notifications never getting processed.

In our case, rematching only needs to get done against the latest evaluation.
Therefore we can skip recovery entirely, since a new evaluation should appear every day anyway.
Then we only need garbage-collect the dangling notifications from crashed listeners once in a while.

Closes #618 (finally)

Due to how `pgpubsub` works, a listener would lock all notifications in the recovery phase on startup.
If it crashes, all notifications are put back to the queue, and only picked up again on next startup.
This would result in old notifications never getting processed.

In our case, rematching only needs to get done against the latest evaluation.
Therefore we can skip recovery entirely, since a new evaluation should appear every day anyway.
Then we only need garbage-collect the dangling notifications from crashed listeners once in a while.
@fricklerhandwerk

fricklerhandwerk commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Tested this locally against a live database, pretty confident it works.

@fricklerhandwerk
fricklerhandwerk added this pull request to the merge queue Sep 10, 2026
Merged via the queue into NixOS:main with commit dcd531d Sep 10, 2026
3 checks 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.

Update pending and draft suggestions with new evaluations

1 participant