Fix unlikely data race when calling BaseExecutor methods #2067
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Calling these methods defined on a value receiver copies the BaseExecutor instance and could cause a data race if another goroutine is writing to it. In practice this wasn't a problem and unlikely anyone would ever run into it on
master
, but it did appear on thefeat/1320-execution-api
branch (#1863) when running:Clipped stack trace:
Also see #1863 (comment) .
(I didn't base this on
master
as I would need to rebase #1863 again and we all dislike the GH reference spam in issues 😅, and I would have to do this on #1863 anyway for the newly added methods.)