Use timeout in connect function, #85
Use timeout in connect function, #85dvoryanchikov wants to merge 1 commit intonetworkupstools:masterfrom
Conversation
…te monitor systems is unreachable that causing loss all other communications, maybe later should make it optional config parameter
|
Hmm, this exposes another problem: when using the timeout patch, it is not obvious that a timeout has occurred. At the very least, this feature should fix the "connect failed: Unknown error" message. I'm not especially happy with the connect timeout code anyway - it was added to support nut-scanner. But in the long run, if we are changing effective TCP timeout behavior, that timeout should be configurable. |
|
trying to resurrect the discussion:
@clepple @zykh @jimklimov thoughts and comments? |
|
Just to be sure, this is orthogonal to rapid data stale-unstale sequences reported a few weeks ago (as #651 OTOH)? |
Debian packaging: explicitly request libssl*-dev so OBS is not confus…
|
Looking at this PR open for so long (and with useful discussion above), I think this particular change will not be merged due to reasons articulated above, but a similar feature (with configuration, docs and all) can be considered in a future release. |
|
Follow-up solution growing at #2847 and while it also modifies the behavior of |
…g timeout for particular addrinfo [networkupstools#2847, networkupstools#85] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…etworkupstools#2847, networkupstools#85] Clang complained about explicit pointers: upsclient.c:1187:37: error: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 [-Werror,-Wcast-align] 1187 | struct sockaddr_in *addr_in = (struct sockaddr_in *)ai->ai_addr; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ upsclient.c:1192:39: error: cast from 'struct sockaddr *' to 'struct sockaddr_in6 *' increases required alignment from 2 to 4 [-Werror,-Wcast-align] 1192 | struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)ai->ai_addr; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Goal achieved via PR #2847 |
avoiding sigpipe in case one of remote monitor systems is unreachable that causing loss all other communications, maybe later should make it optional config parameter.
Example.
Monitoring 3 upses in upsmon.conf:
Before patch (waiting for default kernel timeouts and tcp_syn_retries, blocking all work for 190 seconds and finally got COMMBAD for all upses):
After patch (Pause 10 seconds on unreachable entry, other connections still alive):
So, if timeout is defined since 587d5f8, why not to use it?!
Patch tested and working.