-
-
Notifications
You must be signed in to change notification settings - Fork 85
Refactor stream locking #1320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor stream locking #1320
Conversation
|
I started it yesterday when I got email notification about your PR |
|
@VizDock can u try now ? |
Of course, started it. I'll let you know if/when it stucks.. |
|
This time it was not stuck in the middle of the watching of some channel. Instead it was working fine until I switched channel to some other.. here is the log |
|
@VizDock can u try again ? |
|
yes, downloaded, started.. will report back |
|
Do u have the log and provide the exact timestamp when it was 100% ? in one of the screenshots you have for how long is the system up, maybe you can use that to get the TS, or try to reproduce |
|
@catalinii should we revert the changes for now so master works for users? We can figure out how to replace the old mutex locks at a later stage |
|
I'm reluctant to upgrade myself because I've just found a version that works for me needs (2.0.26) :D |
|
I didn't had time today to reproduce, but this version works stable for 3 days almost. Which is amazing. (except the stuff which I mentioned above.. I consider it a hiccup) |
|
@VizDock can you try the latest diff? |
|
Sure, started it now, will report if something happens. |
|
minisatip.log |
|
Now after 10 minutes CPU went below 1% |
|
Can you run gdb —args ./minisatip … when the cpu is 100% run and provide the output |
|
I just noticed after I posted that even if all Kodi clients to tvheadend are closed (turned off), minisatip still consumes 100% for some time |
|
I think I screwed up, seems I forgot to stop minisatip service (main one) b4 starting it with debugger :) |
|
After you start in the debigger type “run” without quotes to start minisatip in the debugger |
|
If it stops before 100% cpu usage type “continue” |
|
I started it in foreground mode now, switched channels until CPU went to 100%, pressed ctrl+c at that time and wrote your command Thread 10 (LWP 22837 "AD6"): Thread 9 (LWP 22836 "AD5"): Thread 8 (LWP 22834 "AD4"): Thread 7 (LWP 22832 "AD3"): Thread 6 (LWP 22830 "AD2"): Thread 5 (LWP 22828 "AD1"): Thread 4 (LWP 22826 "AD0"): Thread 3 (LWP 22824 "CA_poll"): Thread 2 (LWP 22823 "signal"): Thread 1 (LWP 22817 "minisatip"): |
|
I didn't know if ctrl-c exits minisatip before gdb pauses it, so I tried continue after ctrl+c and it continued. Playing of channel resumed on TV But here is once more (second time) Thread 9 (LWP 22836 "AD5"): Thread 8 (LWP 22834 "AD4"): Thread 7 (LWP 22832 "AD3"): Thread 6 (LWP 22830 "AD2"): Thread 5 (LWP 22828 "AD1"): Thread 4 (LWP 22826 "AD0"): Thread 3 (LWP 22824 "CA_poll"): Thread 2 (LWP 22823 "signal"): Thread 1 (LWP 22817 "minisatip"): |
|
Thanks @VizDock for helping to debug this, it's very much appreciated! |
|
Np |
|
I don't really see anything that could explain the 100% CPU usage. @catalinii ? |
|
There are 2 options: 1) mutexes, but I see pthread_mutex_lock is used which is unlikely to cause cpu usage, also does not appear on all traces @VizDock can u provide more traces? Also provide the top -H screenshot + trace more or less at the same time, maybe we can identity the thread that causes cpu usage |
|
I called them at home and told them to go out and play :) Thread 9 (LWP 31192 "AD5"): Thread 8 (LWP 31190 "AD4"): Thread 7 (LWP 31188 "AD3"): Thread 6 (LWP 31186 "AD2"): Thread 5 (LWP 31184 "AD1"): Thread 4 (LWP 31182 "AD0"): Thread 3 (LWP 31180 "CA_poll"): Thread 2 (LWP 31179 "signal"): Thread 1 (LWP 31173 "minisatip"): |
|
This is second time. Thread 10 (LWP 31193 "AD6"): Thread 9 (LWP 31192 "AD5"): Thread 8 (LWP 31190 "AD4"): Thread 7 (LWP 31188 "AD3"): Thread 6 (LWP 31186 "AD2"): Thread 5 (LWP 31184 "AD1"): Thread 4 (LWP 31182 "AD0"): Thread 3 (LWP 31180 "CA_poll"): Thread 2 (LWP 31179 "signal"): Thread 1 (LWP 31173 "minisatip"): |
|
I am just wondering if thread with name "minisatip" catches ctrl+c and stops doing what is doing b4 I press ctrl+c so output of command is maybe not relevant.. [08/10 17:25:25.162 AD4]: sockets_del: sock 25 Last open socket is at index 26 current_handle -2 Thread 10 (LWP 31193 "AD6"): |
To revert the entire locking changes? this diff should fix the issue, just the cpu usage but not sure if related to the locking |
|
This was the only place where we still kept the old locks in place but wanted to convince myself the behavior with c++ locks still holds in place and it does. ideally want to merge this and see how it goes after |
|
@catalinii ignore my previous comment about reverting 👍 we can merge this and go from there, the deadlocking seems to be fixed |









No description provided.