-
Notifications
You must be signed in to change notification settings - Fork 177
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 condition with stream existence check #3309
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3309 +/- ##
===================================================
- Coverage 34.03772% 34.03410% -0.00362%
===================================================
Files 141 141
Lines 37006 37007 +1
===================================================
- Hits 12596 12595 -1
- Misses 23691 23693 +2
Partials 719 719
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
server/ai_process.go
Outdated
events, err := common.AppendHostname(*resp.JSON200.EventsUrl, host) | ||
if err != nil { | ||
return nil, fmt.Errorf("invalid events URL: %w", err) | ||
} | ||
clog.V(common.VERBOSE).Infof(ctx, "pub %s sub %s control %s events %s", pub, sub, control, events) | ||
|
||
params.node.LivePipelines[params.liveParams.stream] = &core.LivePipeline{} | ||
|
||
startTricklePublish(ctx, pub, params, sess) | ||
startTrickleSubscribe(ctx, sub, params) | ||
startControlPublish(control, params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! I wonder if we can achieve the same effect by calling startControlPublish
before startTricklePublish
without having to change anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right that will work too, done 👍
What does this pull request do? Explain your changes. (required)
In
startTrickleSubscribe()
we check the stream exists inLivePipelines
but this is only set up insidestartControlPublish()
so I'm moving the initialise step above both these functions so there's no longer a race condition.How did you test each of these updates (required)
Does this pull request close any open issues?
Checklist:
make
runs successfully./test.sh
pass