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 random behaviour in executeFilters #164

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

hfastek
Copy link
Contributor

@hfastek hfastek commented Jan 25, 2023

Issue:
#160, #162

Description of changes:
Sometimes (~3 / (100 * ~600 (instance types))), when all exec executions were finished, and:

  • some abort <- true was fired
  • done <- true was fired after wg.Wait()

there was situation, that in select:

select {
	case <-abort: ...
	case <-done: ...

there were both cases to proceed, and then, according to specification:

If one or more of the communications can proceed, a single one that can proceed is chosen via a uniform pseudo-random selection.

I've merged abort and done channels into one verdict channel, and now, if some exec will return false, it will be always ordered within shared channel before always last verdict <- true (after WaitGroup.Wait()).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hfastek hfastek requested a review from a team as a code owner January 25, 2023 14:36
@bwagner5
Copy link
Contributor

Were you able to rerun your test posted in #160 ? If so, did this resolve the anomalous returns?

@hfastek
Copy link
Contributor Author

hfastek commented Jan 26, 2023

Were you able to rerun your test posted in #160 ? If so, did this resolve the anomalous returns?

Yes, and so far, anomalies did not reproduced.

Copy link
Contributor

@bwagner5 bwagner5 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

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.

2 participants