meganz / MEGAcmd

Command Line Interactive and Scriptable Application to access MEGA
Other
1.94k stars 407 forks source link

mega-cmd-server starts consuming 100% cpu when idle for a long time after several sleep cycles #992

Open debasish-raychawdhuri opened 2 months ago

debasish-raychawdhuri commented 2 months ago

MEGAcmd version

1.7.0

Operating System/Platform

Linux

Platform version. In the case of Linux, please enter the Linux distribution you are using.

Garuda Linux (Arch derivative) rolling release

Steps

  1. start mega-cmd-server directly or by invoking mega-cmd
  2. wait for a few hours while going through several sleep cycles
  3. If you are unlucky enough, it starts consuming 1 CPU thread completely like in some spin-lock
  4. restarting mega-cmd-server fixes it until a few more hours and sleep cycles have passed

Expected behavior

mega-cmd-server should consume minimal CPU when idle (nothing to sync)

Actual behavior

mega-cmd-server consumes one CPU-thread completely.

debasish-raychawdhuri commented 2 months ago

Could reproduce it rather quickly with --debug option. Attached the log [mega-cmd-server.log](https://github.com/user-attachments/files/16449772/mega-cmd-server.log)

debasish-raychawdhuri commented 2 months ago

I am running it in verbose mode for a day now and the problem did not show up yet.