Bail out on unmounting filesystem
Posted: August 10th, 2009, 3:29 pm
I'd like SABnzbd+ to quit downloading when it detects one of the folders (especially the incomplete one) can't be read/written anymore. Now it gets reset to download to "$other_disc/downloads/incomplete", so parts get lost and the download ultimately fails.
I also included (large, relevant parts of) the IRC conversation about this feature.
I also included (large, relevant parts of) the IRC conversation about this feature.
IRC wrote:.:19:19:42:. another question: is it possible to make sabnzbd pause/quit when it detects one of the folders can't be read? now it gets reset to download to "my documents", but I've got very little free space on that partition
.:19:24:43:. we don't have a check right now for if a folder can't be read, but that wouldn't be a terrible idea. it won't likely make it for 0.5, though, since we're trying to wrap it up right now.
.:19:25:13:. I'll resort for the moment to start it manually
.:19:25:19:. i suggest bringing that up on the forums
.:19:26:02:. a lot of people set sabnzbd to download to a removable disk, and Weird Stuff happens when there are mountpoints involved.
.:19:26:27:. like, if you have sabnzbd set to download to a removable drive, then you unmount that drive, sabnzbd will gleefully continue downloading to the mountpoint.
.:19:26:42:. when you then mount the drive there again, you can't see the stuff it downloaded.
.:19:27:04:. i'm not sure how we'd handle that, but it needs to be something we look into.
.:19:28:23:. inpheaux: that's exactly my problem
.:19:28:36:. sabnzbd start before my exhdd got properly mounted
.:19:28:56:. so it defaults to "downloads/incomplete"
.:19:30:59:. doesn't the OS return some errorcode when it continues to write to a, suddenly (pulled the plug or something), unmounted filesystem?
.:19:34:58:. well, i'm not sure if there's a way for us to detect that within sabnzbd. maybe if available space fluxuates wildly, check into it.
.:19:35:51:. i'm just not sure if there's a way to get that kind of os level info into python
.:19:51:11:. in *nix, there's no difference between a folder and a drive
.:19:51:49:. if you can see what device the selected folder is on, you might be able to track it that way
.:19:56:41:. really, a program would only act differently if you told it to not create the directory if it didn't exist
.:19:56:50:. and that assumes you're not putting it in the root of the drive
.:20:06:17:. I don't think the program itself creates the directory (downloads/incomplete) if it didn't exist
.:20:06:33:. it does
.:20:06:36:. I bet the OS does that automatically?
.:20:19:05:. right, it'd be a good thing to bail if a mountpoint no longer exists, but there's no way for us to tell if something's
within a mountpoint or not.
.:20:28:06:. it can write there, the problem is the folder no longer exists, depending on what you set it as
.:20:29:52:. i guess we could have it check to see if it has to create a directory in the middle of a download.
.:20:29:59:. wait no, it would always have to do that.
.:20:30:12:. yeah, idunno how we'd fix that.
.:21:36:56:. inpheaux: duz: I was just downloading something & I pulled the plug (J: is my external harddrive)
> 2009-08-10 21:34:15,937 ERROR [assembler] Disk error on creating file J:\Shared\Incomplete\ubuntu.199\ubuntu_9.04.iso
> 2009-08-10 21:34:15,953 ERROR [sabnzbd.misc] Failed making (J:\Shared\ubuntu)
> 2009-08-10 21:34:15,953 ERROR [postproc] Error renaming "J:\Shared\_UNPACK_ubuntu" to "J:\Shared\_FAILED_ubuntu"
.:21:37:02:. can't it quit @error 1?
.:21:37:53:. maybe?
.:21:38:07:. actually, switch, what do you think of this?
...