Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race between Close and Verify of postrs.Verifier #232

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Sep 5, 2023

Part of spacemeshos/go-spacemesh#4910

Both methods are not protected by a mutex, additionally this ensures that no segfaults are triggered when:

  • Close is called twice
  • Verify is called after the verifier is closed (instead it now returns an error)

@fasmat fasmat merged commit 5c876da into develop Sep 7, 2023
13 checks passed
@fasmat fasmat deleted the fix-race-verifier branch September 7, 2023 09:41
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this pull request Sep 7, 2023
## Motivation
Closes #4910, merge after spacemeshos/post#232.

## Changes
- Removed `Start` method, a verifier returned from `NewOffloadingPostVerifier` is ready to be used
- `Close` cancels ongoing verifications and avoids new ones being started
- Updated `node.go` to use the new API

## Test Plan
- existing tests pass

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed
- [x] Update [changelog](../CHANGELOG.md) as needed
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this pull request Sep 7, 2023
## Motivation
Closes #4910, merge after spacemeshos/post#232.

## Changes
- Removed `Start` method, a verifier returned from `NewOffloadingPostVerifier` is ready to be used
- `Close` cancels ongoing verifications and avoids new ones being started
- Updated `node.go` to use the new API

## Test Plan
- existing tests pass

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed
- [x] Update [changelog](../CHANGELOG.md) as needed
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.

None yet

2 participants