adsbcot icon indicating copy to clipboard operation
adsbcot copied to clipboard

adsbcot stops processing aircraft.json, stops receiving Inotify events

Open ampledata opened this issue 1 year ago • 5 comments

ADSBCOT will stop reading /run/*/aircraft.json after some time, and prints nothing else to the logs. An strace shows:

root@airtak-home:/boot# ps -ef|grep -i adsb
root       65480       1  0 May17 ?        00:00:00 /bin/bash /usr/local/sbin/run_adsbcot.sh
root       65481   65480  0 May17 ?        00:33:23 /usr/bin/python3 /usr/local/bin/adsbcot
root      499726   64351  0 23:31 pts/1    00:00:00 grep -i adsb
root@airtak-home:/boot# strace -p 65481
strace: Process 65481 attached
epoll_pwait(3, [], 3, 87, NULL, 8)      = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
getpid()                                = 65481
epoll_pwait(3, [], 3, 100, NULL, 8)     = 0
epoll_pwait(3, [], 3, 0, NULL, 8)       = 0
...

ampledata avatar May 20 '24 22:05 ampledata

To reproduce: sudo systemctl restart dump1090-fa

ampledata avatar May 20 '24 22:05 ampledata

May 20 23:36:44 airtak-home adsbcot[499976]: [INFO] Retrieved 64 ADS-B aircraft messages.
May 20 23:36:45 airtak-home adsbcot[499976]: [INFO] Retrieved 64 ADS-B aircraft messages.

ampledata avatar May 20 '24 22:05 ampledata

Sep 25 16:54:37 airtak-home adsbcot[105299]: [INFO] Retrieved 59 ADS-B aircraft messages.
Sep 25 16:54:38 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('aircraft.json.3BPZ5C') mask=<Mask.CREATE: 256> cookie=0 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:38 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('aircraft.json.3BPZ5C') mask=<Mask.MODIFY: 2> cookie=0 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:38 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('aircraft.json.3BPZ5C') mask=<Mask.MOVED_FROM: 64> cookie=68451 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:38 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('aircraft.json') mask=<Mask.MOVED_TO: 128> cookie=68451 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:38 airtak-home adsbcot[105299]: [INFO] Retrieved 59 ADS-B aircraft messages.
Sep 25 16:54:39 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('stats.json.VT7S8H') mask=<Mask.CREATE: 256> cookie=0 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:39 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('stats.json.VT7S8H') mask=<Mask.MODIFY: 2> cookie=0 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:39 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('stats.json.VT7S8H') mask=<Mask.MOVED_FROM: 64> cookie=68452 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:39 airtak-home adsbcot[105299]: [INFO] <Event name=PosixPath('stats.json') mask=<Mask.MOVED_TO: 128> cookie=68452 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>
Sep 25 16:54:39 airtak-home adsbcot[105299]: [INFO] <Event name=None mask=<Mask.IGNORED: 32768> cookie=0 watch=<Watch path=PosixPath('/run/dump1090-fa') mask=<Mask.MODIFY|MOVED_FROM|MOVED_TO|CREATE: 450>>>

ampledata avatar Sep 25 '24 15:09 ampledata

Looks like this is happening when stats.json is written.

ampledata avatar Sep 25 '24 15:09 ampledata

https://asyncinotify.readthedocs.io/en/latest/asyncinotify.html#asyncinotify.Mask.IGNORED

Looks like the path is removed/moved?

ampledata avatar Sep 25 '24 16:09 ampledata