hessu / aprsc

aprsc, a core APRS-IS server
125 stars 40 forks source link

Connection timeouts seem to cause worker hangs #64

Closed hessu closed 2 years ago

hessu commented 3 years ago

When uplink connections fail through timeout, some packet flow hangs seem to occur; workers get internally delayed packets. Is a lock being held or something?

Probably the worker was stuck on uplink_close() of a second uplink (trying to connect to a server which rejected login), which obtains uplink_client_mutex. make_uplink() holds uplink_client_mutex for the duration of the connection attempt. This deadlock should be fixed.

2021/04/27 02:46:23.415179 aprsc-aggr[1257:7f6c0c8bf700] ERROR: Uplink cwop4: connect to 129.15.108.117:10152 timed out 2021/04/27 02:46:23.415598 aprsc-aggr[1257:7f6c0c901700] ERROR: worker 0: process_outgoing got packet 3003528 aged 7 sec (now 52108 t 52101)

2021/04/27 02:47:15.093992 aprsc-aggr[1257:7f6c0c8bf700] ERROR: Uplink cwop4: connect to 129.15.108.117:10152 timed out 2021/04/27 02:47:15.094631 aprsc-aggr[1257:7f6c0c901700] ERROR: worker 0: process_outgoing got packet 3009256 aged 6 sec (now 52160 t 52154)