0
votes

I have an app on Netty where I'm setting tcpNoDelay to true (for both the server and "child" sockets). When I "curl" to my server with -vN (N disables the client buffer), and then slowly write data to the channel, nothing propagates to the client until some buffer limit is reached, and then it's pushed to the client. I should note that I'm writing back Chunked data (so the client stays connected until we close it).

I have used Wireshark to make sure that I get nothing sent to the client until the buffer limit is reached, and then I see a bunch of TCP packets flood to the client.

Ideally, this should be smooth. Strangely, this doesn't happen with the instance I run on my local machine (Mac OS X Lion, Java 1.6.0_31). Only presents itself on the server which is Ubuntu, Java 1.6.0_20. I can't imagine the slight version mismatch from _20 to _31 is the reason.

Server options being set:

nioStreamBootstrap.setOption("child.tcpNoDelay", true);
nioStreamBootstrap.setOption("child.keepAlive", true);
nioStreamBootstrap.setOption("tcpNoDelay", true);

Client "curl":

curl -vN http://my.remote.server/some/path

My logs show the write being made to the client channel:

--- Message received from downstream
--- Writing message upstream
--- Message received from upstream
--- Writing message downstream

(note that the "Writing message downstream" call immediately precedes the channel.write(obj) call)

So I'm not sure if it's OS-related, Java-related, or Netty-related. Suggestions?

1

1 Answers

0
votes

Appears to be an Ubuntu server issue. Can't replicate issue on CentOS or Mac OS X.