Skip to content

store/postgres: test that a restart keeps tasks and releases locks - #528

Merged
mayawang merged 1 commit into
google:mainfrom
rkb32:restart-test-postgres
Oct 28, 2026
Merged

mayawang merged 1 commit into
google:mainfrom
rkb32:restart-test-postgres

Conversation

@mayawang

Copy link
Copy Markdown
Collaborator

Opened on behalf of @rkb32 while PR creation is limited to collaborators (#448). The commit is theirs.

Adds a Postgres store test for the restart case from #442: save a task, take a lock, close the store without unlocking, reopen it on the same database, then check the task is still there and the lock can be taken once its lease expires.

Test only.

@google-cla

google-cla Bot commented Oct 27, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mayawang

Copy link
Copy Markdown
Collaborator Author

@rkb32 the CLA check is failing on your commit. Could you sign the Google CLA at https://cla.developers.google.com/ with the email on your commit? Then it'll go green for review.

@rakyll

rakyll commented Oct 28, 2026

Copy link
Copy Markdown
Member

I am not truly comprehending the motivation behind this test.

I'm approving it because it causes no harm and is easy to remove.

@rkb32

rkb32 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

It covers the Redis restart issue (#442) on Postgres: tasks survive a restart, and locks expire. Happy to remove it if you’d rather not keep it.

Simulate a crash: save a task, take a lock, close the store without
unlocking, then reopen on the same database. The task must still be
there, and the lock must be takeable once its lease expires.
@rkb32
rkb32 force-pushed the restart-test-postgres branch from 3bae68e to 3ac5cb5 Compare October 28, 2026 01:05
@rakyll

rakyll commented Oct 28, 2026

Copy link
Copy Markdown
Member

LGTM

@mayawang
mayawang merged commit a496fc1 into google:main Oct 28, 2026
10 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.

3 participants