You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the server closes the subscription, the client cannot create a new one. The previously terminated subscription is returned.
I found line, which produce this problem:
QGrpcHttp2Channel.cpp in subscribe function and finishconnection slot:
switch (networkError) { case QNetworkReply::RemoteHostClosedError: qProtoDebug() << "Remote server closed connection. Reconnect silently"; subscribe(subscription, service, client); break; case QNetworkReply::NoError: //Reply closed without error break; default: subscription->error(QGrpcStatus{StatusCodeMap.at(networkError), QString("%1 call %2 subscription failed: %3").arg(service).arg(subscription->method()).arg(errorString)}); break;
replace with:
switch (networkError) { case QNetworkReply::RemoteHostClosedError: qProtoDebug() << "Remote server closed connection. Reconnect silently"; subscribe(subscription, service, client); break; case QNetworkReply::NoError: //Reply closed without error subscription->finished(); break; default: subscription->error(QGrpcStatus{StatusCodeMap.at(networkError), QString("%1 call %2 subscription failed: %3").arg(service).arg(subscription->method()).arg(errorString)}); break;
The text was updated successfully, but these errors were encountered:
Hi @de-wu that's strange that you get NoError when server closes subscription, it should be case above the line you're pointing to. But the problem with subscription is in place. It's not cleaned up and due to the mechanism that prevents duplicating of a subscription, you're not able to get a new one.
I tested this on localhost in Ubuntu 20.04, maybe localhost was the problem. I will check it between hosts in network, because this solution may be problematic in other cases, but when I made this changes it's look correct.
Describe the bug
When the server closes the subscription, the client cannot create a new one. The previously terminated subscription is returned.
I found line, which produce this problem:
QGrpcHttp2Channel.cpp in subscribe function and finishconnection slot:
switch (networkError) {
case QNetworkReply::RemoteHostClosedError:
qProtoDebug() << "Remote server closed connection. Reconnect silently";
subscribe(subscription, service, client);
break;
case QNetworkReply::NoError:
//Reply closed without error
break;
default:
subscription->error(QGrpcStatus{StatusCodeMap.at(networkError), QString("%1 call %2 subscription failed: %3").arg(service).arg(subscription->method()).arg(errorString)});
break;
replace with:
switch (networkError) {
case QNetworkReply::RemoteHostClosedError:
qProtoDebug() << "Remote server closed connection. Reconnect silently";
subscribe(subscription, service, client);
break;
case QNetworkReply::NoError:
//Reply closed without error
subscription->finished();
break;
default:
subscription->error(QGrpcStatus{StatusCodeMap.at(networkError), QString("%1 call %2 subscription failed: %3").arg(service).arg(subscription->method()).arg(errorString)});
break;
The text was updated successfully, but these errors were encountered: