Bug 3876 - vsm can run out of low ports and stop working
Summary: vsm can run out of low ports and stop working
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: 3.1.2
Hardware: PC All
: P2 Normal
Target Milestone: MediumPrio
Assignee: Pierre Ossman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 13:16 CEST by Pierre Ossman
Modified: 2019-05-21 12:52 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2011-07-07 13:16:21 CEST
It seems vsmserver can exhaust the available low ports on a system when it is using them for connections to vsmagent. I noticed this because tlwebadm couldn't start because 1010 was already used.

We should start setting SO_REUSEADDR for these connections.
Comment 1 Pierre Ossman cendio 2011-07-07 14:19:05 CEST
The async stuff made this rather difficult. Adding SO_REUSEADDR was easy, but then connect() fails instead as you can easily get a socket address collision if you already have an ongoing connection to that agent.

We need to either keep some global state so we know which ports to avoid, or make XMLRPCClientChannel capable of looping on a higher level so that it can catch the failed connect() and retry using another port.

The latter might be more appealing as we also have a bug in XMLRPCClientChannel where it doesn't try every response from getaddrinfo(), which it should as it is crucial to get good IPv6 behaviour.

Not doing this right now though, but a hackish version (bug 3878) instead.
Comment 3 Pierre Ossman cendio 2015-02-25 11:02:02 CET
This page discussed the same issue with regard to the LPD protocol:

http://doc.dvgu.ru/admin/LPRng/rfc1179ref.htm
Comment 4 Karl Mikaelsson cendio 2015-03-18 09:25:00 CET
We should look into setting SO_LINGER for the sockets as well.

Note You need to log in before you can comment on or make changes to this bug.