[GH-ISSUE #108] [Bug] CPU usage 100% when offline #94

Closed
opened 2026-03-03 01:19:46 +03:00 by kerem · 4 comments
Owner

Originally created by @krackout on GitHub (Aug 9, 2022).
Original GitHub issue: https://github.com/d99kris/nmail/issues/108

Originally assigned to: @d99kris on GitHub.

I I've noticed that CPU usage goes 100% when nmail is started offline. It must have appeared somewhere around version 3.74 I think. The bug mustn't be there when I started using nmail; I'm often offline plus the fan of my CPU makes noticeable noise when going 100%. I initially thought it was incidental but I can reproduce it by simply opening nmail without an active internet connection. I'm attaching a verbose log file.

nmail--offline-100percent-log.txt

Originally created by @krackout on GitHub (Aug 9, 2022). Original GitHub issue: https://github.com/d99kris/nmail/issues/108 Originally assigned to: @d99kris on GitHub. I I've noticed that CPU usage goes 100% when `nmail` is started offline. It must have appeared somewhere around version 3.74 I think. The bug mustn't be there when I started using nmail; I'm often offline plus the fan of my CPU makes noticeable noise when going 100%. I initially thought it was incidental but I can reproduce it by simply opening nmail without an active internet connection. I'm attaching a verbose log file. [nmail--offline-100percent-log.txt](https://github.com/d99kris/nmail/files/9287456/nmail--offline-100percent-log.txt)
kerem closed this issue 2026-03-03 01:19:46 +03:00
Author
Owner

@d99kris commented on GitHub (Aug 9, 2022):

Hi, I checked here and I can reproduce it too. I haven't checked the code for the root cause yet, but based on my testing it seems a temporary workaround is to manually start nmail in offline mode: nmail -o

This is a quite bad bug though, so I'll definitely look into fixing it as soon as I get a chance.

<!-- gh-comment-id:1209018748 --> @d99kris commented on GitHub (Aug 9, 2022): Hi, I checked here and I can reproduce it too. I haven't checked the code for the root cause yet, but based on my testing it seems a temporary workaround is to manually start nmail in offline mode: `nmail -o` This is a quite bad bug though, so I'll definitely look into fixing it as soon as I get a chance.
Author
Owner

@Kabouik commented on GitHub (Aug 9, 2022):

Just posting because I observed the same issue long before 3.73, probably even early last year, so it might be necessary to look into other commits too (I hope I am not wrong though). Usually this would happen when I put my laptop to sleep and then wake it the next day and have no Internet connection, but still have nmail instances running in Termux.

Apparently I failed to report it, sorry. It might be partly related to #74? I suppose the CPU hog when offline could be an extension over longers duration of the CPU spike when trying to connect?

<!-- gh-comment-id:1209092999 --> @Kabouik commented on GitHub (Aug 9, 2022): Just posting because I observed the same issue long before 3.73, probably even early last year, so it might be necessary to look into other commits too (I hope I am not wrong though). Usually this would happen when I put my laptop to sleep and then wake it the next day and have no Internet connection, but still have nmail instances running in Termux. Apparently I failed to report it, sorry. It might be partly related to #74? I suppose the CPU hog when offline could be an extension over longers duration of the CPU spike when trying to connect?
Author
Owner

@d99kris commented on GitHub (Aug 10, 2022):

I can confirm that this is a very old bug. It affects the scenario when nmail is started and unable to connect to the IMAP server at first login attempt. The high CPU usage should not occur if there was first a connection made and later was lost, and neither in the case when nmail is manually started in offline mode with -o flag.

I have some idea on how it should be fixed. Will prepare a fix and perform some testing on my side before pushing a fix.

<!-- gh-comment-id:1210670286 --> @d99kris commented on GitHub (Aug 10, 2022): I can confirm that this is a very old bug. It affects the scenario when `nmail` is started and unable to connect to the IMAP server at first login attempt. The high CPU usage should not occur if there was first a connection made and later was lost, and neither in the case when `nmail` is manually started in offline mode with `-o` flag. I have some idea on how it should be fixed. Will prepare a fix and perform some testing on my side before pushing a fix.
Author
Owner

@d99kris commented on GitHub (Aug 13, 2022):

This should be fixed with above commit. Please let me know if you're still encountering any issues.

<!-- gh-comment-id:1214148208 --> @d99kris commented on GitHub (Aug 13, 2022): This should be fixed with above commit. Please let me know if you're still encountering any issues.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nmail#94
No description provided.