Skip to content

Conversation

@sambuc
Copy link

@sambuc sambuc commented Dec 1, 2025

No description provided.

kanya-approve and others added 13 commits November 26, 2025 11:09
* Ensure the mutex is not copied, even when the nodeServer is copied by
  storing a pointer to the mutex, instead of the mutex itself

* Use Mutex instead of RWMutex, as having two readers of the variable at
  the same time means we are going to write the state at the same time,
  corrupting the state file on storage.

* Mutex / RWMutex are not recursive / re-entrant in Go, so in two cases
  we do not call `Unlock()` through `defer` as `persistState()` also
  takes the lock.

* As a rule of thumb, Locking a Mutex should be as close as possible to
  the resource requiring it, to minimize the size of the critical
  section / the time spent holding the lock.
@sambuc sambuc changed the title Sambuc/feat merge restart pr 2 sambuc/feat merge restart pr 2 Dec 1, 2025
@sambuc sambuc marked this pull request as ready for review December 1, 2025 10:36
@sambuc sambuc requested a review from a team as a code owner December 1, 2025 10:36
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