fix(service): Prevent potential corruption in state diffs #2578
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Compliance
Continuwuity/Web Interface
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity!2578
Loading…
Reference in a new issue
No description provided.
Delete branch "jade/short-race"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This fixes a non-atomicity issue. Also fixes incorrect
calculation of a buffer size that would result in
reallocation.
@ -237,2 +235,6 @@}let shortstatehash = self.services.globals.next_count().unwrap();/// Allocates a fresh short state hash ID without publishing it yet.pub fn next_shortstatehash(&self) -> Result<ShortStateHash> {self.services.globals.next_count()}Why not just use
services.globals.next_countdirectly? this seems like a redundant alias functionchief you're the one introducing the new function that just calls another function where that function call could just be inlined for both callsites 🗿
This is actually so I don't have to add globals as a service dependency to the state compressor, but I can do that if you want
Is there a reason not to?
Not really, although the service code is beginning to irritate me
mmm would be interested in hearing more, but probably not in forgejo review comments. If you don't wanna add a dependency then leave a comment in the function that explains what you just told me so I don't accidentally inline the calls later
Nah I'll inline it and maybe start dealing with the service code later
still wanna hear what your gripes are with the service code tho
b01d27b5920aaa42188e0aaa42188e3379badbd4