-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
bugfix: SrsAsyncCallWorker::cycle to crash #2282
Conversation
bluestn
commented
Apr 13, 2021
•
edited by winlinvip
Loading
edited by winlinvip
ccd8c86
to
b59c37e
Compare
1ca9308
to
8d44b98
Compare
return false; | ||
} | ||
|
||
if ( dvr_apply->args.empty()) { |
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.
I checked the situation where trd
is NULL in SrsAsyncCallWorker::cycle
, and it only occurs when DvrPlan is being deleted.
SrsDvrPlan::~SrsDvrPlan()
{
srs_freep(async);
}
SrsAsyncCallWorker::~SrsAsyncCallWorker()
{
srs_freep(trd);
}
When DvrPlan stops, it will have a stop and clean task, which will cause a switch.
void SrsDvrPlan::on_unpublish()
{
async->stop();
}
void SrsAsyncCallWorker::stop()
{
flush_tasks();
srs_cond_signal(wait);
trd->stop();
}
In combination with the reload of dvr_apply
, the above logic will be triggered frequently.
srs_error_t SrsDvr::on_reload_vhost_dvr_apply(string vhost)
{
SrsConfDirective* conf = _srs_config->get_dvr_apply(req->vhost);
bool v = srs_config_apply_filter(conf, req);
on_unpublish();
if ((err = on_publish()) != srs_success) {
return srs_error_wrap(err, "on publish");
}
}
So the problem should be in this place. To be determined specifically.
TRANS_BY_GPT3
A more suitable solution:
I mentioned a new issue: #2181.
|
Still need to thank @bluestn for the Pull Request.
|