SALAD: be more defensive and make sure the main thread never dies
This issue happened twice in my farm, which takes down the entire farm:
Apr 12 09:22:04 mupuf-gateway salad[6328]: 2023-04-12 09:22:04,000 [SaladThread] [WARNING] run: Traceback (most recent call last):
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/valve_gfx_ci/salad/salad.py", line 98, in run
Apr 12 09:22:04 mupuf-gateway salad[6328]: buf = ser.recv()
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/valve_gfx_ci/salad/console.py", line 75, in recv
Apr 12 09:22:04 mupuf-gateway salad[6328]: buf = self.device.read(1)
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/serial/serialposix.py", line 595, in read
Apr 12 09:22:04 mupuf-gateway salad[6328]: raise SerialException(
Apr 12 09:22:04 mupuf-gateway salad[6328]: serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Apr 12 09:22:04 mupuf-gateway salad[6328]: Exception in thread SaladThread:
Apr 12 09:22:04 mupuf-gateway salad[6328]: Traceback (most recent call last):
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
Apr 12 09:22:04 mupuf-gateway salad[6328]: self.run()
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/valve_gfx_ci/salad/salad.py", line 79, in run
Apr 12 09:22:04 mupuf-gateway salad[6328]: self._update_ports()
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/valve_gfx_ci/salad/salad.py", line 55, in _update_ports
Apr 12 09:22:04 mupuf-gateway salad[6328]: ports = set([p.device for p in serial.tools.list_ports.comports()])
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/serial/tools/list_ports_linux.py", line 102, in comports
Apr 12 09:22:04 mupuf-gateway salad[6328]: for info in [SysFS(d) for d in devices]
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/serial/tools/list_ports_linux.py", line 102, in <listcomp>
Apr 12 09:22:04 mupuf-gateway salad[6328]: for info in [SysFS(d) for d in devices]
Apr 12 09:22:04 mupuf-gateway salad[6328]: File "/usr/lib/python3.10/site-packages/serial/tools/list_ports_linux.py", line 52, in __init__
Apr 12 09:22:04 mupuf-gateway salad[6328]: self.vid = int(self.read_line(self.usb_device_path, 'idVendor'), 16)
Apr 12 09:22:04 mupuf-gateway salad[6328]: TypeError: int() can't convert non-string with explicit base