BiglySoftware / BiglyBT

Feature-filled Bittorrent client based on the Azureus open source project
https://www.biglybt.com
GNU General Public License v2.0
1.55k stars 153 forks source link

If BiglyBT takes too long to shut down, the shut down gets killed and it must recheck so many torrents when it restarts #2374

Closed as-muncher closed 2 years ago

as-muncher commented 2 years ago

Java 1.8.0_202 (64 bit) Oracle Corporation c:\program files\biglybt\jre

SWT v4942r22, win32, zoom=100, dpi=120 Windows 10 v10.0, amd64 (64 bit) B2.9.0.1_B15/4 az3

Basically the title says it all. I have an encrypted hard drive, highly fragmented. When I shut down BiglyBT, there can still be downloads downloading in the background while BiglyBT's trying to shut down. Plus if you're doing other hard drive tasks, too, that can cause Bigly to take a long time to shut down. I think the timeout is 2.5 minutes, after which the process gets terminated. However, when I start up BiglyBT, then it has to recheck a bunch of torrents, at least the data that was in use, and gives me a warning that it did not shut down tidily. Well, that wasn't my fault.

[01:52:20] [stderr] [01:52:20] [stderr] dumpThreads (AEJavaManagement.java:116), dumpThreads (AEDiagnostics.java:278), perform (CoreImpl.java:1674), runSupport (TimerEvent.java:133), runSupport (Timer.java:330), AERunnable.run, ThreadPool.runIt [01:52:20] [stderr] DEBUG::Fri Dec 17 01:52:20 MST 2021::com.biglybt.core.impl.CoreImpl$14::perform::1678: [01:52:20] [stderr] Shutdown blocked, force exiting [01:52:20] [stderr] runSupport (TimerEvent.java:133), runSupport (Timer.java:330), AERunnable.run, ThreadPool.runIt

as-muncher commented 2 years ago

I find that I'm spending more time just rechecking torrents than actually doing transfers. It's like all the settings I chose just go out the window when Bigly takes too long to shut down or if there's a user-initiated crash. Torrents are checked fully, not just the pieces in use. Plus, I'm in airplane mode too, a lot of times, and bigly is checking, then shut down aborts, so it's the whole cycle next time I load up. It's like my setting for allocation is ignored, and option to check files in use is thrown out. Why doesn't bigly just save the status after each torrent it finishes checking, so that the next time it loads up, it knows that that torrent is checked already?

as-muncher commented 2 years ago

Couldn't someone just add an option to set the timeout limit? I mean, I understand if BiglyBT terminates if the computer is shutting down. But, I don't want to have to keep re-checking the entire torrents every time I start up BiglyBT because it takes more than 2.5 minutes to stop all the torrents and shut down. First off, there should be a kill switch to terminate all network activity when I choose to shut down BiglyBT, so that files are not continuing to download or upload. Next, it should save the torrent save state for each individual torrent, often, so that if one torrent gets checked, then Bigly knows right away. When BiglyBT terminates because it takes too long to shut down, then it's like it does not know that it already checked a torrent completely, but instead checks all those torrents fully anyways, and not even just the pieces that were in use, but the whole thing, even though I had selected to do only the pieces that were in use. And the thing is, when my computer is in airplane mode, and I startup BiglyBT, it checks the torrents, and then I shut BiglyBT down, and it takes more than 2.5 minutes to shut down, and thus terminates, then it checks all the torrents on startup again, even though I didn't even connect to the web. At least if one torrent gets checked, that save that info somewhere, so that when Bigly crashes or terminates, when it starts up again, it doesn't check that torrent again.

parg commented 2 years ago

Don't run so many active torrents. Don't use a slow encrypted drive to store torrent state.

BiglyBT is doing something while it is shutting down, it isn't just wasting time to piss you off.

as-muncher commented 2 years ago

Don't run so many active torrents. Don't use a slow encrypted drive to store torrent state.

BiglyBT is doing something while it is shutting down, it isn't just wasting time to piss you off.

Oh my gosh.

as-muncher commented 2 years ago

Perhaps what I can do is use a different torrent client to do most of the heavy work, and only let BiglyBT look for swarm merging. Your response @parg, I think, is not much different than if I went to my doctor, told him that it hurts too much when I lift up my elbows to feed myself, and he tells me that he guesses I'll have to be fed through a tube from then on. At least I was able to make you aware of this issue. Maybe if others also say they are dealing with this issue will you consider looking further at it. Thanks for responding, anyways.

parg commented 2 years ago

I just don't have the bandwidth to look into everything

as-muncher commented 2 years ago

I just don't have the bandwidth to look into everything

I understand. I'll do what I can with how much BiglyBT works for me, but at least I thought I would let you know. I didn't think it would be that big of a fix to just add some option to change the shutdown timer so that at least I can set it to a high value or 0 for infinite. Is it helpful to post any debug messages? or just forget about it?

parg commented 2 years ago

OK, I'll add the ability to amend the force-shutdown timeout

parg commented 2 years ago

B25 will have an option under Startup&Shutdown: Shutdown to set the time limit (default 2 mins)

as-muncher commented 2 years ago

@parg Thank you. That should help quite a bit.