Skip to content

Fix event collector#13067

Merged
dain merged 2 commits intotrinodb:masterfrom
dain:fix-event-collector
Jul 19, 2022
Merged

Fix event collector#13067
dain merged 2 commits intotrinodb:masterfrom
dain:fix-event-collector

Conversation

@dain
Copy link
Member

@dain dain commented Jul 2, 2022

Description

Fix basic thread safety issues in EventsCollector.

Related issues, pull requests, and links

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

@dain dain requested review from electrum and losipiuk July 2, 2022 16:11
@cla-bot cla-bot bot added the cla-signed label Jul 2, 2022
@dain dain force-pushed the fix-event-collector branch from fee40d2 to d2cda22 Compare July 2, 2022 16:17
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix. The writer thread may be different from the reader thread, and without the synchronization, you can get an old view of the list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is not testing for split completed, so explicitly ignore them incase we somehow ended up with an extra split, which is very unlikely given this is a VALUES query

Copy link
Member

@phd3 phd3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

nit: may be change the last commit msg to Add more debug information

dain added 2 commits July 18, 2022 12:57
Test should explicitly ignore split events which it is not testing
@dain dain force-pushed the fix-event-collector branch from 9dd6ffa to 28363d0 Compare July 18, 2022 20:26
@dain dain merged commit b22e599 into trinodb:master Jul 19, 2022
@dain dain deleted the fix-event-collector branch July 19, 2022 02:47
@github-actions github-actions bot added this to the 391 milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Flaky test TestEventListener.testPlanningFailure

3 participants