users@jersey.java.net

[Jersey] CLOSE_WAIT sockets on client disconnect

From: <rpujar_at_inocybe.com>
Date: Tue, 2 Aug 2016 19:33:41 +0000 (UTC)

Hello experts,

I am using a Northbound client to access the Opendaylight SDN
Controller (ODL) RESTful api which uses JAX-RS javax.ws.rs v2.0 and its
implementation Jersey API v1.17.
When a device connects, ODL exposes the REST services through port
8443. Thus, on startup the Northbound client tries to access the device
using RESTConf at port 8443.

I have many ~50 devices that come up. The socket count for port 8443
increases and when it reaches ~90 the devices are brought down. This
ends up in many 8443 sockets in CLOSE_WAIT state on the ODL (server)
side.

Is there any outstanding issue/bug for Jersey or javax.ws.rs closing
the connections that could possibly explain these CLOSE-WAIT sockets?

More context:
[1]: Resource class and method definition. The PUT REST service is
where I see the issue.
[2]: REST Service implementation for PUT request, where the Response
object is returned.

I would appreciate any leads that would help me with this issue. Please
let me know if you need me to add more information.

[1]
https://github.com/opendaylight/netconf/blob/ede6d9b71393a3058904feafc8
b7ba0dd691627a/restconf/sal-rest-connector/src/main/java/org/opendaylig
ht/netconf/sal/rest/api/RestconfService.java

[2]
https://github.com/opendaylight/netconf/blob/87082c4351ffa19202f4368f33
41974ca3bade1d/restconf/sal-rest-connector/src/main/java/org/opendaylig
ht/netconf/sal/restconf/impl/RestconfImpl.java#L651

Thanks,
~rashmi