@@ -276,13 +276,17 @@ public void configureBootstrap(boolean domainSocket,
276
276
277
277
SocketOptions .TcpUserTimeoutOptions tcpUserTimeoutOptions = options .getTcpUserTimeout ();
278
278
279
+ boolean applied = false ;
279
280
if (IOUringProvider .isAvailable ()) {
280
281
IOUringProvider .applyTcpUserTimeout (bootstrap , tcpUserTimeoutOptions .getTcpUserTimeout ());
282
+ applied = true ;
281
283
} else if (io .lettuce .core .resource .EpollProvider .isAvailable ()) {
282
284
EpollProvider .applyTcpUserTimeout (bootstrap , tcpUserTimeoutOptions .getTcpUserTimeout ());
283
- } else {
284
- logger .warn ("Cannot apply TCP User Timeout options to channel type " + channelClass .getName ());
285
+ applied = true ;
285
286
}
287
+
288
+ LettuceAssert .assertState (applied ,
289
+ "TCP User Timeout options could not be applied. Native transports (io_uring or epoll) are required." );
286
290
}
287
291
}
288
292
@@ -291,17 +295,22 @@ public void configureBootstrap(boolean domainSocket,
291
295
if (options .isKeepAlive () && options .isExtendedKeepAlive ()) {
292
296
293
297
SocketOptions .KeepAliveOptions keepAlive = options .getKeepAlive ();
298
+ boolean applied = false ;
294
299
295
300
if (IOUringProvider .isAvailable ()) {
296
301
IOUringProvider .applyKeepAlive (bootstrap , keepAlive .getCount (), keepAlive .getIdle (), keepAlive .getInterval ());
302
+ applied = true ;
297
303
} else if (io .lettuce .core .resource .EpollProvider .isAvailable ()) {
298
304
EpollProvider .applyKeepAlive (bootstrap , keepAlive .getCount (), keepAlive .getIdle (), keepAlive .getInterval ());
305
+ applied = true ;
299
306
} else if (ExtendedNioSocketOptions .isAvailable () && !KqueueProvider .isAvailable ()) {
300
307
ExtendedNioSocketOptions .applyKeepAlive (bootstrap , keepAlive .getCount (), keepAlive .getIdle (),
301
308
keepAlive .getInterval ());
302
- } else {
303
- logger .warn ("Cannot apply extended TCP keepalive options to channel type " + channelClass .getName ());
309
+ applied = true ;
304
310
}
311
+
312
+ LettuceAssert .assertState (applied ,
313
+ "Extended TCP keepalive options could not be applied. Native transports (io_uring or epoll) or a compatible NIO transport are required." );
305
314
}
306
315
307
316
}
0 commit comments