I am using a jar file implementing custom functionality which uses jersey as REST client (version 2.22.1). While everything seems to work fine for a few calls, for a specific HTTP call I get a "Error: Writing to server", but only when running in ubuntu.
The error occurs when running a unit test on my development PC. My development PC is an Ubuntu 16.04 with Oracle JDK:
~$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Running the same test from a windows machine, gives me no error. On my windows machine:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
I can only suppose that the jvm version is the cause of the error. Is this a known issue? Does this apply to the ubuntu jvms in general, or only to the specific version? Should changing to Open JDK correct the error? Could you please provide a hint on how I could avoid this error while being on Ubuntu?
The full error's stacktrace is:
Caused by: java.io.IOException: Error writing to server
... 40 more
this is not a know issue.
Oracle JDK should work, you don't need to consider switching to Open JDK.
We are using linux machines as our test infra, so I'd think this should be stable and your issue might be related to configuration of your box. The error you see is not something we can influence form Jersey, seems like underlying TCP connections is closed at some point and then the IOException is thrown when the client tries to write into that.
If I were you, I'd try to compare network level config of the windows machine and the linux box.
On 26/09/16 08:49, Pantelis Natsiavas wrote:
Thank you very much Pavel for your time. I really appreciate it.
I have run the same test on another Ubuntu PC (similar setup) and the same problem occurs. Both of these Ubuntu machines where the problem came up have been setup by me for development purposes (one in the lab, one in my home office, different networks/subnets, targeting the same server). Therefore, if there were any special network configurations I would have known.
Since you say this is a TCP level error, I guess there might be a default parameter in Ubuntu that causes the problem in large HTTP posts. Do you have any suggestions? What kind of parameters could affect such behavior? Do you have any idea where to search?
2016-09-26 19:05 GMT+03:00 Pavel Bucek <[hidden email]>:
Pavel was right.
The solution is on the TCP level and not on the JVM version or configuration. I have changed the my ubuntu networking settings and the error is gone. I suppose, it occured only to large HTTP requests, because the TCP windows were too small or something.
I followed the instructions in http://www.slashroot.in/linux-network-tcp-performance-tuning-sysctl article to set the following settings:
net.ipv4.tcp_window_scaling = 1
Please note that the error occured on an HTTP request with a load of about 90kbytes. I needed to play around with the value of the window assigned to each TCP connection (187380) in order to succeed.
2016-09-27 9:46 GMT+03:00 Pantelis Natsiavas <[hidden email]>:
|Free forum by Nabble||Edit this page|