Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1658 closed defect (fixed)

I2PSnark "forgets" data location if not available

Reported by: uvok Owned by: zzz
Priority: minor Milestone: 0.9.23
Component: apps/i2psnark Version: 0.9.21
Keywords: Cc:
Parent Tickets: Sensitive: no

Description

I'm running I2P 0.9.21 under Linux.

I added a torrent to I2PSnark and set the data location to a location that's not mounted by default (/run/media/me/extdata). The torrent started downloading.

When I reboot my PC, the location is not mounted. When I now start I2P before mounting the disk, the torrent goes into the state stopped, but also resets the data location to ~/.i2p/i2psnark/. Thus it would start downloading the torrent again, even if it was already completed.

To undo this, I manually have to go into ~/.i2p/i2psnark.config.d/ and find the correct .config file to set the location to /run/media/me/extdata again.

Is this excpected behaviour?

Subtickets

Change History (4)

comment:1 Changed 4 years ago by zzz

Milestone: undecided0.9.23
Status: newaccepted

Reproduced here.

comment:2 Changed 4 years ago by zzz

Cause:

The Snark object is not created in the first DirMonitor? pass due to the path error.

Then cleanupTorrentStatus() runs, doesn't find the Snark object, and so it deletes the config file for the torrent.

A minute later, DirMonitor? runs again, finds the .torrent file but no Snark object, and so adds it. A new config file is created with the default data location.


We can keep a list of broken Snarks so cleanupTorrentStatus() doesn't delete them, I guess. Then the DirMonitor? should throw out the same error every minute. Let's try that…

comment:3 Changed 4 years ago by zzz

Resolution: fixed
Status: acceptedclosed

In f26cea6a39323764ac04531a118cd366b27e9d1a 0.9.22-5

It was too hard to keep a list of broken snarks. Fix is just to skip the cleanupTorrentStatus() call completely if any torrent errors out. If the errors are resolved, we will call it at the next i2psnark startup.

It will now attempt to add the torrent once a minute in each DirMonitor? pass, and log an error on failure. When the error is resolved, the torrent will be added without forgetting the location.

comment:4 Changed 4 years ago by zzz

related: #1575

Note: See TracTickets for help on using tickets.