Merge branch 'master' into release to roll forward up to cl/355211070.

This commit is contained in:
hai007
2021-02-02 11:25:14 -08:00
2 changed files with 8 additions and 0 deletions
@@ -18,6 +18,7 @@
#include "core/internal/offline_frames.h"
#include "proto/connections/offline_wire_formats.pb.h"
#include "platform/base/feature_flags.h"
#include "platform/public/logging.h"
#include "platform/public/mutex.h"
#include "platform/public/mutex_lock.h"
@@ -142,6 +143,12 @@ bool EndpointChannelManager::ChannelState::RemoveEndpoint(
item->second.disconnect_reason = reason;
auto channel = item->second.channel;
if (channel) {
// If the channel was paused (i.e. during a bandwidth upgrade negotiation)
// we resume to ensure the thread won't hang when trying to write to it.
if (FeatureFlags::GetInstance().GetFlags().resume_before_disconnect) {
channel->Resume();
}
channel->Write(parser::ForDisconnection());
SystemClock::Sleep(kDataTransferDelay);
}
+1
View File
@@ -27,6 +27,7 @@ class FeatureFlags {
// Holds for all the feature flags.
struct Flags {
bool enable_cancellation_flags = false;
bool resume_before_disconnect = true;
};
static const FeatureFlags& GetInstance() {