Skip to content

lib/db: Don't call backend.Commit twice (ref #6337) - #6342

Merged
calmh merged 1 commit into
syncthing:masterfrom
imsodin:db/twoCommits
Feb 14, 2020
Merged

calmh merged 1 commit into
syncthing:masterfrom
imsodin:db/twoCommits

Conversation

@imsodin

@imsodin imsodin commented Feb 13, 2020 •

Copy link
Copy Markdown
Member

In recalcMeta we first call t.withAllFolderTruncated and then t.Commit, while it isn't allowed to call anything except Release after Commit. For some reasons that doesn't blow up in tests. It did in a very weird way (segfault deep in leveldb) in a local feature branch, took me a while to find the cause (leveldb should return an error, not segfault, but that's hardly worth spending effort on).

Also from a conceptual standpoint I believe it's wrong to call t.Commit or t.Release anywhere else than the place where the transaction was created.

@calmh

calmh commented Feb 14, 2020 •

Copy link
Copy Markdown
Member

frack... This explains why there was no commit in recalcMeta and I was confused about it. Ah well.

Also from a conceptual standpoint I believe it's wrong to call t.Commit or t.Release anywhere else than the place where the transaction was created.

mmhm, no shit.

@calmh
calmh merged commit 05e23f1 into syncthing:master Feb 14, 2020
@calmh calmh added this to the v1.4.0 milestone Feb 14, 2020
@imsodin
imsodin deleted the db/twoCommits branch February 14, 2020 07:19
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Feb 14, 2021
@syncthing syncthing locked and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants