Skip to content

fix: Race Condition in Revocation Database#16

Open
edbjunwang wants to merge 4 commits into
masterfrom
jw/PEM-6034
Open

fix: Race Condition in Revocation Database#16
edbjunwang wants to merge 4 commits into
masterfrom
jw/PEM-6034

Conversation

@edbjunwang
Copy link
Copy Markdown
Contributor

@edbjunwang edbjunwang commented May 22, 2026

This PR is to fix an potential issue that two concurrent PostgreSQL backends calling revoke() simultaneously can:

  • Both pass the duplicate check (neither sees the other's entry yet)
  • Both write their entries — resulting in duplicate revocation entries
  • Or interleave writes, corrupting the database file

The change is to use flock() to lock the file description, when another process calls revoke() and the previous process is not done yet, the second process would return error like below:

ERROR:  Could not lock revocation database, it is already locked by another process.

@edbjunwang edbjunwang requested a review from edbshubham May 22, 2026 12:16
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.

1 participant