Skip to content

Commit f192199

Browse files
generatedunixname89002005232357meta-codesync[bot]
authored andcommitted
Revert D101266356
Summary: Fix unintended consequendes of previous change: Reviewed By: kwaugh Differential Revision: D101491570 fbshipit-source-id: 6111aba579e4dd1744945a199708fe69cabad30b
1 parent 2bbbcf5 commit f192199

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

wangle/acceptor/ManagedConnection.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ class ManagedConnection : public folly::HHWheelTimer::Callback,
130130
* Called when the connection age timeout fires. The default implementation
131131
* removes the connection from the ConnectionManager (if
132132
* detachOnConnectionAgeTimeout is set) and then calls closeWhenIdle().
133+
* Subclasses can override to customize behavior.
133134
*/
134-
void onConnectionAgeTimeout();
135+
virtual void onConnectionAgeTimeout();
135136

136137
/**
137138
* Dump the state of the connection to the log

wangle/bootstrap/ServerBootstrap-inl.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,17 @@ class ServerAcceptor : public Acceptor,
114114
}
115115
}
116116

117-
void closeWhenIdle() override {
118-
dropConnection();
119-
}
120-
117+
void closeWhenIdle() override {}
121118
void dropConnection(const std::string& /* errorMsg */ = "") override {
122119
auto ew = folly::make_exception_wrapper<AcceptorException>(
123120
AcceptorException::ExceptionType::DROPPED, "dropped");
124121
pipeline_->readException(ew);
125122
}
123+
void onConnectionAgeTimeout() override {
124+
// ServerConnection has no graceful drain (closeWhenIdle is a no-op),
125+
// so drop the connection immediately.
126+
dropConnection();
127+
}
126128
void dumpConnectionState(uint8_t /* loglevel */) override {}
127129

128130
void deletePipeline(wangle::PipelineBase* p) override {

0 commit comments

Comments
 (0)