If anyone wants to see where a report cycle is actually spending its time, py-spy will tell you without modifying anything. Install it into a throwaway venv and dump the running weewxd: python3 -m venv ~/pyspy-venv ~/pyspy-venv/bin/pip install py-spy pgrep -af weewxd sudo ~/pyspy-venv/bin/py-spy dump –pid <pid> It attaches to the live process, prints a stack for every thread, and detaches. No restart, no config change, no debug logging. I run weewx from a pip install, not in a container. My understanding is that under Docker you’d run py-spy on the host and point it at the host-side PID of the weewxd process rather than the one you see inside the container, and that there may be a ptrace permission to sort out. I haven’t done it, so someone who uses containers should confirm. Here’s one from my system (WeeWX 5.4.0, LiveSeasons (personal skin), Pi 5), taken during a report cycle. I’ve cut the idle service threads: Thread 1767872 (idle): “MainThread” read (serial/serialposix.py:565) … [seven idle service threads elided] Thread 379811 (active): “ReportThread” execute (weedb/sqlite.py:249) guarded_fn (weedb/sqlite.py:38) getSql (weewx/manager.py:586) firstGoodStamp (weewx/manager.py:326) create_sync (weewx/manager.py:303) sync (weewx/manager.py:307) init (weewx/manager.py:142) open (weewx/manager.py:187) open_manager (weewx/manager.py:921) getLatestForecastRows (user/nws.py:1702) alerts (user/nws.py:1620) respond (cheetah…alerts_inc….py:297) handleCheetahInclude (Cheetah/Template.py:1712) respond (cheetah_…alerts_html_tmpl….py:167) generate (weewx/cheetahgenerator.py:335) generate (weewx/cheetahgenerator.py:226) generate (weewx/cheetahgenerator.py:226) run (weewx/cheetahgenerator.py:166) start (weewx/reportengine.py:482) run (weewx/reportengine.py:252) _bootstrap_inner (threading.py:1043) _bootstrap (threading.py:1014) The report thread is named ReportThread, so it’s easy to find in the output. Two things this makes visible. First, exactly what the cycle is doing at that instant — which generator, which template, which query, right down to the line. Second — and more to the point of this thread — it settles the concurrency question directly. Every thread in the process is listed, so if two report cycles are running at once, you get two entries with two distinct thread IDs. One dump answers it. No inferring from CPU load, no relying on what does or doesn’t get logged. For what it’s worth, I don’t think a second report thread is being launched in the log posted here. weewx will launch one alongside a running cycle, but only once the existing thread has been alive for max_wait seconds (600 by default). In that log the report thread was about 300 seconds old when the process took the database-locked exception and shut down, and the restart resets the launch time — so the 600 s threshold never gets close. That’s also why changing max_wait had no effect: neither branch of that test is being reached. On Aug 4, 2026, at 6:26 AM, John Kline <[email protected]> wrote: -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/weewx-user/F999250A-28DD-4003-8AE1-24111EFEAB14%40johnkline.com. |
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... Greg Troxel
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... matthew wall
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... [email protected]
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... [email protected]
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... [email protected]
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... Tom Keffer
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... Tom Keffer
- Re: [weewx-user] catching the 'why' of engine.... Vince Skahan
- Re: [weewx-user] catching the 'why' of engine.... 'John Kline' via weewx-user
- Re: [weewx-user] catching the 'why' of engine.... [email protected]
