-
Notifications
You must be signed in to change notification settings - Fork 691
Description
We are using reactor netty server as a standalone application not as part of spring boot
Our server comes up fine and serves request as expected but at the time of shutdown with a SIGTERM signal, we are observing that the server sends FIN,ACK signals to connected clients instead of GOAWAY.
Expected Behavior
Server should close gracefully sending GOAWAY singnals on all the connections
Actual Behavior
Server sends FIN,ACK instead of GOAWAY
Steps to Reproduce
PFA a reproducible example. It is gradle project.
It simply contains one Main class which servers a GET API on 8080 port with uri '/'
curl -ivX GET localhost:8080/ --http2-prior-knowledge
You can use the above curl request to use it
To simulate, I used a 3rd party http client called vegeta which constantly sends traffic on 1 connection
and took the tcpdump using:
tcpdump -i localinterface port 8080
i kill the running java process using:
kill -15 processid
Step1: start the server
Step2:start capturing tcpdump
Step3:start the traffic using vegeta client(i ran 1 message per second)
Step4:kill the process while traffic is still running
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("starting server");
LoopResources loop = LoopResources.create("event-loop");
Consumer<Builder> h2Settings= s -> s.maxConcurrentStreams(1000);
HttpServer server = HttpServer.create().port(8080)
.protocol(HttpProtocol.H2C) // Set HTTP/2 protocol//HttpProtocol.H2 is for TLS
.runOn(loop)
.channelGroup(new DefaultChannelGroup(new DefaultEventExecutor()))
//.wiretap(true)
.http2Settings(h2Settings)
.idleTimeout(Duration.ofMinutes(10))
.route(routes ->
routes.get("/",(req,res)->{
System.out.println("request processing");
return res.status(HttpResponseStatus.ACCEPTED).send(Mono.just(Unpooled.wrappedBuffer("{abcde}".getBytes())));
}));
DisposableServer disposableServer = server.bindNow();
System.out.println("after");
Runtime.getRuntime().addShutdownHook(new Thread(()-> {
System.out.println("shutdown");
disposableServer.disposeNow();
System.out.println("disposed");
}));
disposableServer.onDispose().block();
System.out.println("disposed completely");
}Your Environment
version:
implementation("io.projectreactor.netty:reactor-netty-http:1.1.12")
- Reactor version(s) used:1.1.12
- Other relevant libraries versions (eg.
netty, ...): - JVM version (
java -version):21.0.7 - OS and version (eg.
uname -a):linux