po5 / thumbfast

High-performance on-the-fly thumbnailer script for mpv
Mozilla Public License 2.0
758 stars 34 forks source link

To many events queued #90

Closed natural-harmonia-gropius closed 1 year ago

natural-harmonia-gropius commented 1 year ago

Using latest version.

image

po5 commented 1 year ago

Any more details? Were thumbnails working for a few seconds, minutes?
Did you have to hover the timeline a bunch to trigger this?

natural-harmonia-gropius commented 1 year ago

few seconds

https://github.com/po5/thumbfast/assets/50797982/cd613a7f-62d0-490e-8e35-795a6a8a7ca5

po5 commented 1 year ago

Does reverting 7d813a94e937be62806c73841a02691aae1a910a fix it?

natural-harmonia-gropius commented 1 year ago

No

po5 commented 1 year ago

Max is 1000 events, it couldn't possibly be coming from our observed properties, must be some recursion somewhere. Can you try removing or (rotate == nil and not disabled)? This is the most obvious cause I can think of.

natural-harmonia-gropius commented 1 year ago

Not fix. And freeze happens before error message.

christoph-heinrich commented 1 year ago

If it's some recursion somewhere, you can try finding it with print(debug.traceback())

po5 commented 1 year ago

Reverted until I can reproduce this and figure it out, use the observe-properties branch if you want to take a crack at it.

hooke007 commented 1 year ago

And freeze happens before error message.

Yes, I never saw any error in console but thumbnail just quickliy lost response.

hooke007 commented 1 year ago

@po5 Freezing was introduced by https://github.com/po5/thumbfast/commit/be884c6ee263e170dda72167e3bf532f70c2d8ca

po5 commented 1 year ago

Weird, surely it's possible to keep the Windows socket open. I'll try booting into Windows.

po5 commented 1 year ago

Turns out the pipe just stops responding after we send it 4096 bytes of data. Gotta love Windows. I'll reopen the file every time we hit 4096 bytes, problem solved and we keep the speedup of reopening a file, most of the time.

po5 commented 1 year ago

Should be fixed?

N-R-K commented 1 year ago

Turns out the pipe just stops responding after we send it 4096 bytes of data. Gotta love Windows.

That can also happen on linux/posix if the other end isn't draining the pipe (although PIPE_MAX is typically higher than 4KiB, at least on linux). Or are you saying it stops after sending 4KiB in total - regardless of whether the other end drained it or not?

po5 commented 1 year ago

Total, the pipe seems to never clear. I tried different opening modes.
If you know a way to get it to work, that would obviously be nice.