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

Slave crashes when nuking release where files are in-progress #328

Open
hrxcodes opened this issue Feb 19, 2024 · 0 comments
Open

Slave crashes when nuking release where files are in-progress #328

hrxcodes opened this issue Feb 19, 2024 · 0 comments

Comments

@hrxcodes
Copy link
Contributor

hrxcodes commented Feb 19, 2024

Describe the bug
Nuking / Deleting / Moving / Wiping a release with active transfers might kill the slave process as some threads are writing/reading as the folder is being moved/removed on the backing device.

Autofreespace running before the slave has finished remerging would trigger this as well.

Expected behavior

  • Abort+block transfers to paths being nuked or wiped, similar to glftpd's "this file is being deleted" and don't crash the slave

Maybe we can be a bit smarter on how/when we raise exceptions for missing files, most of the time the backing filesystem will not be the problem.

Additional context

Example of a crash:

public Root getRootForFile(String path) throws FileNotFoundException {
for (Root root : _roots) {
File file = new File(root.getPath() + PhysicalFile.separatorChar + path);
if (file.exists()) {
return root;
}
}
throw new FileNotFoundException(path + " wasn't found in any root");
}

DEBUG 18:41:07,397 [Slave Main Thread] org.drftpd.slave.Slave [] - Slave fetched org.drftpd.common.network.AsyncCommandArgument[index=f1,name=checksum,args=/linux/irunarch/btw.iso]
DEBUG 18:41:07,398 [AsyncCommandHandler - class org.drftpd.common.network.AsyncCommandArgument] org.drftpd.slave.Slave [] - Slave wrote response - AsyncResponseException exception is - /linux/irunarch/btw.iso wasn't found in any root
DEBUG 18:41:07,398 [AsyncCommandHandler - class org.drftpd.common.network.AsyncCommandArgument] org.drftpd.slave.Slave [] -
DEBUG 18:41:07,412 [Slave Main Thread] org.drftpd.slave.Slave [] - Lost connection to the master, may have been kicked offline
WARN  18:41:07,412 [Slave Main Thread] org.drftpd.slave.Slave [] - Shutdown() called
WARN  18:41:07,412 [Slave Main Thread] org.drftpd.slave.Slave [] - Closing _sin
WARN  18:41:07,412 [Slave Main Thread] org.drftpd.slave.Slave [] - Closing _sout
WARN  18:41:07,412 [Slave Main Thread] org.drftpd.slave.Slave [] - Closing _socket
INFO  18:41:07,412 [Slave Main Thread] org.drftpd.slave.Slave [] - Setting slave status online to: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant