griff / metaz

Two letters better than MetaX
https://metaz.maven-group.org/
MIT License
415 stars 56 forks source link

MetaZ freezing on lookup (again!) #215

Closed musicdiv579 closed 4 years ago

musicdiv579 commented 4 years ago

Hi fellow encoders, See lots about this issue, but not a clear fix. I'm running MetaZ on two systems - one running Mojave, one running Catalina, and on both systems MetaZ is freezing on lookup of TV shows. My process is entirely manual -- Handbrake encoding to .m4v, and then straight into MetaZ for metadata, then I import to iTunes (or, ugh, the "TV App") on another Mac.

In its current state it'll usually pull up the list of episodes after I give it the parameters; then it'll let me select the first episode, but then goes to beachball-of-doom. Purported fixes such as deactivating the "Alert Window" plug-in did not work.

For those who want to check my process, I put the screengrab on youtube at https://www.youtube.com/watch?v=923MbzASlVQ. The cursor goes to beachball after I clicked on the first episode "Pilot," at which point MetaZ became unresponsive and I had to force-quit.

Appreciative of any wisdom. MD579

griff commented 4 years ago

Looking at the video and testing it locally my guess is that it is trying to load ~750 images and failing. I did not get the issue locally (I am still on High Sierra) but none of the ~750 results I got back had any images attached to them.

jmcintyre commented 4 years ago

I was seeing this over the weekend, but not this evening. I'm not sure what changed. I'm trying to get my build environment back up and running so I can look into it if it starts again.

blake-bauman commented 4 years ago

Has anyone found a temporary workaround? The only thing working for me is to do one video at a time so that it only searches once...which gets tough for a TV series.

jmcintyre commented 4 years ago

No, but the cause is a deadlock in ASIHTTPRequest because it holds a lock on the cancel mutex while MetaZ responds to an event, forwards the handler to the main thread, and then MetaZ calls back into the library. At this point, I’m not clear on whether the library can be changed, or not, and if not, how the various workarounds might impact MetaZ.

blake-bauman commented 4 years ago

Sure. That makes sense.

jmcintyre commented 4 years ago

ASIHTTPRequest is no longer maintained. I have a workaround in that code, but it would require us to fork the project, and I'm not convinced it is a completely safe change (although certainly causes fewer problems than the current deadlock).

@griff, I think it would be best if the code were rewritten in terms of NSUrlSession or possibly one of the related classes. I've had good experience using them in the past, and they can handle this. But it isn't a minor revision, and I'm still struggling to find an answer to the problem with Carthage and Xcode 11.3. What is your thought on what to do?

There is also a possible change where we could make the thread not wait for the main thread to complete, but that change seems like it would be a much larger impact as it is a general function in MetaZ.

griff commented 4 years ago

I have rewritten both search plugins to use NSURLSession so when #229 is released this deadlock should be a thing of the past.

griff commented 4 years ago

The fix is now released.

griff commented 4 years ago

I am closing this issue since it was fixed in a release 9 days ago and there haven’t been any comments about that fix not working to fix this issue