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

SRS3.0 origin_cluster with multiple coworkers doesn't work #1223

Closed
rageJune opened this issue Sep 17, 2018 · 1 comment
Closed

SRS3.0 origin_cluster with multiple coworkers doesn't work #1223

rageJune opened this issue Sep 17, 2018 · 1 comment
Assignees
Labels
Bug It might be a bug. EnglishNative This issue is conveyed exclusively in English.
Milestone

Comments

@rageJune
Copy link

when merging the code of fix#464 on SRS3.0, origin_cluster with multiple coworkers doesn't work.
when multiple coworkers, in the loop it tries the first coworker and if not active origin, it breaks.

if (!info->edge && _srs_config->get_vhost_origin_cluster(req->vhost) && source->inactive()) {
    vector<string> coworkers = _srs_config->get_vhost_coworkers(req->vhost);
    for (int i = 0; i < (int)coworkers.size(); i++) {
        int port;
        string host;
        string url = "http://" + coworkers.at(i) + "/api/v1/clusters?"
            + "vhost=" + req->vhost + "&ip=" + req->host + "&app=" + req->app + "&stream=" + req->stream;
        if ((err = SrsHttpHooks::discover_co_workers(url, host, port)) != srs_success) {
            return srs_error_wrap(err, "discover coworkers, url=%s", url.c_str());
        }

// when the coworker didn't work, it returns, never try other coworkers.
// should be continue??

@winlinvip winlinvip added the Bug It might be a bug. label Oct 7, 2018
@winlinvip winlinvip added this to the srs 3.0 release milestone Oct 7, 2018
@winlinvip
Copy link
Member

Dup to #1520

@winlinvip winlinvip self-assigned this Sep 11, 2021
@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. EnglishNative This issue is conveyed exclusively in English.
Projects
None yet
Development

No branches or pull requests

2 participants