airdcpp-web / airdcpp-release-validator

AirDC++ extension that performs various validations for release directories
1 stars 3 forks source link

Extension exited due to socket timeout after sleep #4

Closed doobnet closed 7 years ago

doobnet commented 7 years ago

I usually put the computer that's running the client into sleep mode when I'm not using it. When I wake it up I get a notification in the client that the extension has exited due to a socket timeout.

Is this something that can be handled automatically without having to manually start the extension?

maksis commented 7 years ago

I'm not sure how to solve that yet, but if you make custom builds, you may check out the file node_modules\airdcpp-extension\dist\ManagedExtension.js and code related to pinging

doobnet commented 7 years ago

I haven't looked yet at ManagedExtension.js but I would imagine that the client needs to somehow keep track of if an extension is running or not, otherwise the start and stop button wouldn't work. Then it would need to start the extension if it's not running. It can also restart the extension if it would crash. There are many tools for process watching, that makes sure a process is always running. Should be possible to implement something like that.

maksis commented 7 years ago

I'm not able to test the sleep case right now and I don't know the error message you got, but did you run into the case where the extension killed itself (code)? The extension-side ping is meant to detect cases when the application dies and I'd prefer having the extension not exiting when that's not the actual case.

Possibly the extension could just disconnect the socket and reconnect if it sees gaps in sent ping attempts, which basically is what the Web UI does already.

doobnet commented 7 years ago

I'm not able to test the sleep case right now and I don't know the error message you got, but did you run into the case where the extension killed itself (code)

Yes, that seems to be the case. I got that error message, Socket timed out.

I'm wondering if when the computer wakes up, if the extension perhaps resumes execution before the client.

Possibly the extension could just disconnect the socket and reconnect if it sees gaps in sent ping attempts, which basically is what the Web UI does already.

Yeah, either that or the client could start the extension when it notice that it's not running.

maksis commented 7 years ago

The application will now restart extensions that exit with the new timeout code 124. I don't like the idea of restarting crashing extensions as I'll rather annoy the user enough with those so that the issues will be reported (and it would also require handling of possible infinite restart loops etc).

You can test these changes by downloading the latest develop version and making a new build of this extension with updated dependencies.

doobnet commented 7 years ago

Thanks. I don't have access right now to the computer where this issue occurred, but I'll report back as soon as I've tested this.

doobnet commented 7 years ago

I finally tested your fix and it works. Thanks 😃.