🐛 Bug Report: Possible race condition when using Postgres #153

Closed
opened 2025-10-07 23:55:29 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @ItalyPaleAle on GitHub.

Reproduction steps

This CI test failed because the Pocket ID binary crashed due to a data race.

The test succeeded on 2nd attempt, indicating some flakiness.

It seems that the data race is in the Gorm library, but there may be something we can do in Pocket ID itself to prevent them.

Opening this issue so I can look into it later.

Expected behavior

Should not have data races

Actual Behavior

Data race causes the binary to crash during test

Version and Environment

main

Log Output

backend.log

Originally created by @ItalyPaleAle on GitHub. ### Reproduction steps [This CI test](https://github.com/pocket-id/pocket-id/actions/runs/15890219851/job/44811337395) failed because the Pocket ID binary crashed due to a data race. The test succeeded on 2nd attempt, indicating some flakiness. It seems that the data race is in the Gorm library, but there may be something we can do in Pocket ID itself to prevent them. Opening this issue so I can look into it later. ### Expected behavior Should not have data races ### Actual Behavior Data race causes the binary to crash during test ### Version and Environment main ### Log Output [backend.log](https://github.com/user-attachments/files/20929498/backend.log)
Author
Owner

@ItalyPaleAle commented on GitHub:

This really seems an issue upstream. I've opened go-gorm/gorm#7539

Will close this issue. When it's fixed, I'll update Pocket ID

@ItalyPaleAle commented on GitHub: This really seems an issue upstream. I've opened go-gorm/gorm#7539 Will close this issue. When it's fixed, I'll update Pocket ID
Author
Owner

@ItalyPaleAle commented on GitHub:

It happened once in a test (which is not unusual for race conditions). I will take another look, it's not even clear if the bug is in our code or in gorm (the goroutine that crashed was gorm's).

@ItalyPaleAle commented on GitHub: It happened once in a test (which is not unusual for race conditions). I will take another look, it's not even clear if the bug is in our code or in gorm (the goroutine that crashed was gorm's).
Author
Owner

@kmendell commented on GitHub:

@ItalyPaleAle did you want to look at this, elias nor i can reproduce it.

@kmendell commented on GitHub: @ItalyPaleAle did you want to look at this, elias nor i can reproduce it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#153