File tree Expand file tree Collapse file tree 6 files changed +31
-12
lines changed Expand file tree Collapse file tree 6 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -340,10 +340,12 @@ class TTlsConnection
340
340
341
341
bool IsIdle () const override
342
342
{
343
- return
344
- Underlying_->IsIdle () &&
345
- ActiveIOCount_ == 0 &&
346
- !Failed_;
343
+ return ActiveIOCount_ == 0 && !Failed_;
344
+ }
345
+
346
+ bool IsReusable () const override
347
+ {
348
+ return IsIdle () && Underlying_->IsReusable ();
347
349
}
348
350
349
351
TFuture<void > Abort () override
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ TReusableConnectionState::TReusableConnectionState(
17
17
18
18
TReusableConnectionState::~TReusableConnectionState ()
19
19
{
20
- if (Reusable && OwningPool && Connection->IsIdle ()) {
20
+ if (Reusable && OwningPool && Connection->IsReusable ()) {
21
21
OwningPool->Release (std::move (Connection));
22
22
}
23
23
}
Original file line number Diff line number Diff line change @@ -206,6 +206,11 @@ struct TFakeConnection
206
206
return true ;
207
207
}
208
208
209
+ bool IsReusable () const override
210
+ {
211
+ return true ;
212
+ }
213
+
209
214
TFuture<void > Abort () override
210
215
{
211
216
THROW_ERROR_EXCEPTION (" Not implemented" );
Original file line number Diff line number Diff line change @@ -645,6 +645,11 @@ class TFDConnectionImpl
645
645
!PeerDisconnectedList_.IsFired ();
646
646
}
647
647
648
+ bool IsReusable ()
649
+ {
650
+ return IsIdle ();
651
+ }
652
+
648
653
TFuture<void > Abort (const TError& error)
649
654
{
650
655
YT_LOG_DEBUG (error, " Aborting connection" );
@@ -1213,6 +1218,11 @@ class TFDConnection
1213
1218
return Impl_->IsIdle ();
1214
1219
}
1215
1220
1221
+ bool IsReusable () const override
1222
+ {
1223
+ return Impl_->IsReusable ();
1224
+ }
1225
+
1216
1226
TFuture<void > Abort () override
1217
1227
{
1218
1228
return Impl_->Abort (TError (EErrorCode::Aborted, " Connection aborted" ));
Original file line number Diff line number Diff line change @@ -73,16 +73,19 @@ struct IConnection
73
73
virtual const TNetworkAddress& GetLocalAddress () const = 0;
74
74
virtual const TNetworkAddress& GetRemoteAddress () const = 0;
75
75
76
- // Returns true if connection is not is failed state and has no
77
- // active IO operations.
76
+ // ! Returns true if connection is not is failed state and has no
77
+ // ! active IO operations.
78
78
virtual bool IsIdle () const = 0;
79
79
80
+ // ! Returns true if connection can be reused by a pool.
81
+ virtual bool IsReusable () const = 0;
82
+
80
83
virtual bool SetNoDelay () = 0;
81
84
virtual bool SetKeepAlive () = 0;
82
85
83
86
TFuture<void > Abort () override = 0;
84
87
85
- // SubscribePeerDisconnect is best effort and is not guaranteed to fire.
88
+ // ! This callback is best effort and is not guaranteed to fire.
86
89
virtual void SubscribePeerDisconnect (TCallback<void ()> callback) = 0;
87
90
};
88
91
Original file line number Diff line number Diff line change @@ -523,10 +523,9 @@ using TAllTransports = ::testing::Types<
523
523
TRpcOverGrpcImpl<false , false >,
524
524
TRpcOverGrpcImpl<false , true >,
525
525
TRpcOverGrpcImpl<true , false >,
526
- TRpcOverGrpcImpl<true , true >
527
- // XXX(babenko): temporarily off
528
- // TRpcOverHttpImpl<false>,
529
- // TRpcOverHttpImpl<true>
526
+ TRpcOverGrpcImpl<true , true >,
527
+ TRpcOverHttpImpl<false >,
528
+ TRpcOverHttpImpl<true >
530
529
>;
531
530
532
531
using TWithAttachments = ::testing::Types<
You can’t perform that action at this time.
0 commit comments