Skip to content

keepalive not working #3940

@nomercy9

Description

@nomercy9

Hi, I am currently facing an issue that after configuring the keepalive, I still cannot see any keepalive being sent in TCPDUMP.

06:12:49.118951 enP57554s1 Out IP [client vm ip].[port] > [server lb ip].https: Flags [P.], seq 14565:19180, ack 7298, win 501, options [nop,nop,TS val 2833495177 ecr 3777546711], length 4615
06:12:49.120686 enP57554s1 In  IP [server lb ip].https > [client vm ip].[port]: Flags [.], ack 19180, win 486, options [nop,nop,TS val 3777560471 ecr 2833495177], length 0
06:12:49.120686 eth0  In  IP [server lb ip].https > [client vm ip].[port]: Flags [.], ack 19180, win 486, options [nop,nop,TS val 3777560471 ecr 2833495177], length 0
06:12:49.120698 azv80b6b3c7132 Out IP [server lb ip].https > [app container ip].[port]: Flags [.], ack 19180, win 486, options [nop,nop,TS val 3777560471 ecr 2833495177], length 0
06:12:49.789801 enP57554s1 In  IP [server lb ip].https > [client vm ip].[port]: Flags [P.], seq 7298:7648, ack 19180, win 501, options [nop,nop,TS val 3777561140 ecr 2833495177], length 350
06:12:49.789801 eth0  In  IP [server lb ip].https > [client vm ip].[port]: Flags [P.], seq 7298:7648, ack 19180, win 501, options [nop,nop,TS val 3777561140 ecr 2833495177], length 350
06:12:49.789858 azv80b6b3c7132 Out IP [server lb ip].https > [app container ip].[port]: Flags [P.], seq 7298:7648, ack 19180, win 501, options [nop,nop,TS val 3777561140 ecr 2833495177], length 350
06:12:49.789916 azv80b6b3c7132 In  IP [app container ip].[port] > [server lb ip].https: Flags [.], ack 7648, win 501, options [nop,nop,TS val 2833495848 ecr 3777561140], length 0
06:12:49.789943 eth0  Out IP [client vm ip].[port] > [server lb ip].https: Flags [.], ack 7648, win 501, options [nop,nop,TS val 2833495848 ecr 3777561140], length 0
06:12:49.789947 enP57554s1 Out IP [client vm ip].[port] > [server lb ip].https: Flags [.], ack 7648, win 501, options [nop,nop,TS val 2833495848 ecr 3777561140], length 0
06:17:26.197582 enP57554s1 In  IP [server lb ip].https > [client vm ip].[port]: Flags [R.], seq 1638214070, ack 19180, win 0, length 0
06:17:26.197582 eth0  In  IP [server lb ip].https > [client vm ip].[port]: Flags [R.], seq 1638214070, ack 19180, win 0, length 0
public static void main(String[] args) {
		ConnectionProvider provider =
				ConnectionProvider.builder("custom")
				                  .maxConnections(50)
				                  .maxIdleTime(Duration.ofSeconds(20))           
				                  .maxLifeTime(Duration.ofSeconds(60))           
				                  .pendingAcquireTimeout(Duration.ofSeconds(60)) 
				                  .evictInBackground(Duration.ofSeconds(120))    
				                  .build();

		HttpClient client = HttpClient.create(provider)
                      .option(ChannelOption.SO_KEEPALIVE, true)            
				          .option(EpollChannelOption.TCP_KEEPIDLE, 100)        
				          .option(EpollChannelOption.TCP_KEEPINTVL, 10)        
				          .option(EpollChannelOption.TCP_KEEPCNT, 2);

Expected Behavior

After 100s of idle, there should be keepalive sent to the server. and after 2 Keepalive, client should sent Fin to the server to close the connection.

Actual Behavior

No Keepalive nor FIN captured in TCPDUMP but only server RST the connection after idle timeout.

Possible Solution

  • Reactor version(s) used:
    Springboot 3.4
  • JVM version (java -version): 21
  • OS and version (eg. uname -a):

Metadata

Metadata

Assignees

Labels

for/user-attentionThis issue needs user attention (feedback, rework, etc...)type/bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions