MediaElch icon indicating copy to clipboard operation
MediaElch copied to clipboard

MediaElch locks up on "Save/Save all"

Open workflowsguy opened this issue 1 year ago • 9 comments

Describe the bug After downloading info for new episodes of a TV show and then clicking "Save" or "Save all" or pressing CMD+S, MediaElch locks up and has to be force-quit. After that, various other running apps also lock up. Those apps also have to be force-quit and Mac has to be rebooted to get back to a stable system.

Tried this several times with both ME 2.10 and 2.10.2 on two different Macs with macOS 10.13.6 and 13.4.1, respectively.

To Reproduce Steps to reproduce the behavior:

  1. load info for TV show, season, or episode(s) from internet source
  2. click on "Save" or "Save all" buttons or press CMD+S
  3. ME locks up, spinning Beach ball is shown

Expected behavior New data should be saved in seconds, after which ME becomes responsive again

MediaElch Version:

  • [x] 2.10.2 stable

Operating System:

  • [ ] Windows
  • [x] macOS
  • [ ] Linux (distribution: .)

Additional context The images or information downloaded for a show are not stored in the folder of the TV show, ME locks up immedately on "Save/Save all".

TV shows are stored on an SMB-mounted network folder.

I had used earlier versions of ME on those computers where this issue did not occur.

workflowsguy avatar Jul 12 '23 10:07 workflowsguy

Never had issues on my Mac. But I'm also not using SMB folders. Others have reported issues with SMB in the past. I never got to debug them, though.

Thanks for reporting!

bugwelle avatar Jul 15 '23 13:07 bugwelle

@bugwelle,

according to my information, AFP was deprecated in favour of SMB in macOS 10.9 Mavericks (i.e. 2013) and AFP server support was removed in macOS 10.11 Big Sur.

If it helps you, I can create a process analysis in Activity Monitor when ME locks up and attach it here.

workflowsguy avatar Jul 17 '23 09:07 workflowsguy

If you could do that, it would be appreciated!

IIRC, SMB, similar to NFS, can block an application if a write operation fails. I think I read somewhere that certain errors are not properly handled. But that is only hearsay. I didn't look into it.

bugwelle avatar Jul 17 '23 16:07 bugwelle

Well, I'll be ...

When trying to reproduce the issue, I was no longer able to. Saving data for a new TV show and episodes worked correctly with both of the Macs where it had failed before.

To the best of my knowledge, nothing has changed in the connection to the network folders or the network file server software or configuration itself. So I can only suspect that something central that is common to both of the machines has changed (maybe a somewhere file in the data folder structure of the TV show/movies directory structure?).

workflowsguy avatar Jul 20 '23 07:07 workflowsguy

Argh... I feared that it is not reproducible. As always with network drives. :smile: I'll keep this issue open, but won't work on it with high priority.

Maybe I'll get to test MediaElch with network drives someday.

bugwelle avatar Jul 23 '23 11:07 bugwelle

Should the issue reappear, I will capture the process dump from Activity monitor and attach it here, as promised.

One additional observation and hypothesis:

When ME locked up before saving the new files. Activity monitor showed a % CPU value slightly above 0 (in contrast to application lock-ups where the % CPU value is shown as >= 98 %).

So could this maybe be caused by a situation where ME blocks waiting on a response from a specific (uncommon) OS API call that has a very long timeout value (or none at all)?

workflowsguy avatar Jul 24 '23 07:07 workflowsguy

A low CPU activity may point to MediaElch waiting for a file lock.


Could be related: https://serverfault.com/questions/204812/how-to-prevent-samba-from-holding-a-file-lock-after-a-client-disconnects

bugwelle avatar Jul 24 '23 10:07 bugwelle

Although pushing an older issue here maybe I can give certainty that it has something to do with smb, because I ran into a similar issue. Afterwards I mounted the network drive as sshfs and everything worked fine. Maybe this helps? Just found it to be interesting. Didn't check any logs though, simply switched.

dingnz avatar Jan 24 '24 12:01 dingnz

Definitely SMB and us trying to save files synchronously. Tested it with SMB a while ago but didn't get to properly debug it. Thanks for telling me. :)

bugwelle avatar Jan 24 '24 18:01 bugwelle