activitywatch: Gap of Negative Duration could NOT be Fixed - AW Server stuck in loop without exiting
- I am on the latest ActivityWatch version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- OS name and version: Arch Linux x86_64
- ActivityWatch version: v0.13.2
Describe the bug
Within one specific week I am getting:
2025-01-07 06:06:55 [WARNING]: Gap was of negative duration but could be safely merged (-165.163s). This message will only show once per batch. (aw_transform.flood:46)
2025-01-07 06:06:55 [WARNING]: Gap was of negative duration and could NOT be safely merged (-330.409s). This warning will only show once per batch. (aw_transform.flood:52)
the query will run out of time and the banner
AxiosError: timeout of 90000ms exceeded. See dev console (F12) and/or server logs for more info.
is displayed at the top of the webpage. However the activitywatch server will still continue to use 100% of one CPU core until manually stopped.
To Reproduce
I start the server
The server is running
I can change to the previous week, no problem
Note the cpu load on the right, the spike occurs when I change the week, but its okay, because the calculation is finished after some time.
Now if I change to the week before that the CPU load does not decrease
At some time a timeout message is displayed and a warning in the logs
But even though the request is supposed to time out, the CPU usage stays at 100%
Pressing Ctrl C does not do anything
But sending SIGTERM works
Expected behavior
Just seeing the stats of that week
Documentation
Logs: aw-log-bug.log
Additional context
Maybe related to #239
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 20 (6 by maintainers)
I don’t use
aw-qtmuch. But since you are on linux you can set up a systemd service to runaw-server-rustwith the restart=always option true. Chatgpt or Claude can help you figure it out.The latest version of the aw-server-rust does not have the same issue?
Keep it open. Might be useful if somebody else has the same issue. We’ll archive the repo if we finally ditch the python server.
On Thu, 16 Jan 2025, 00:01 Caspar, @.***> wrote:
Yes, it is mentioned multiple times in the logs
however there it seems like everything could be safetly merged.
@0xbrayo As far as I can tell the issue does not occur in
aw-server-rust: ) I cloned the repo, built the project, ran it in debugging mode using cargo and tested it by stepping through the last weeks.I think this is the line where the logger displayes the negative duration: https://github.com/ActivityWatch/aw-core/blob/6a58ec59c16c57933fce7bad4453449168c83ebd/aw_transform/flood.py#L53