Skip to content
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

Refreshing a group will sometimes never end #11

Closed
mattwright324 opened this issue Jan 23, 2019 · 3 comments
Closed

Refreshing a group will sometimes never end #11

mattwright324 opened this issue Jan 23, 2019 · 3 comments
Labels
bug Something's broken or doesn't seem right

Comments

@mattwright324
Copy link
Owner

Sometimes when refreshing a group, and it happens not often, the refresh process will seemingly never end but it appears that it finished because the bar is to the end and the comments number is not changing anymore.

This appears to be an issue caused by threading and for some reason the thread(s) causing the issue are not ending.

@mattwright324 mattwright324 added the bug Something's broken or doesn't seem right label Jan 23, 2019
@mattwright324
Copy link
Owner Author

Two potential solutions while this issue exists:

  1. One way that sometimes works is to click the Stop button which will attempt to end the thread(s) causing the issue.
  2. If that doesn't work you can close the program using the X in the top right of window. Before closing, the app will commit any changes to the database so nothing you just downloaded will be lost.

@mattwright324
Copy link
Owner Author

I may have come across a partial reason to why this bug existed and believe it has been fixed in 5b64965 on the replace-ytapi branch. It will be in the next release.

How it worked was that one of the properties that kept threads alive was progress, if it was below 1.0 or 100% it would stay alive as there could potentially be more work. There have been counting issues, one of which is fixed (such as checking for private videos in playlists). To fix this, I am no longer depending on the arbitrary progress value but the state of other producing threads. While the thread's queue has objects or threads that produce for it's queue are still alive, the thread will still stay alive. Visual to show new refresh-threading-flow:


Each colored block represents a group of threads that perform the described operation.

@mattwright324
Copy link
Owner Author

Discovered a second potential issue that could cause stuck threading, previously the Channel Id Consumer threads would be able to accumulate a list of over 50 channelIds from the queue to query YouTube about. The max you may pass into YouTube's API is 50, any more and it gives you an error. There was no way the thread could fix it itself, perpetually querying and receiving errors, unable to end.

This second problem is now also fixed and each Channel Id Consumer thread will accumulate a list up to the maximum of 50 and no more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's broken or doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant