sungshon / PimpMyStremio

Local add-on manager for Stremio
MIT License
381 stars 51 forks source link

Per request timeout #19

Closed sungshon closed 5 years ago

sungshon commented 5 years ago

Considering adding a timeout per add-on request (instead of just add-on loading).

The timeout should be larger then eval's (currently 60 seconds) for obvious reasons. (considering 120 seconds)

If the timeout is reached, PMS should either drop the request or kill the add-on entirely.

Killing the add-on is obviously safer, as it can safeguard against an infinite loop scenario, but problematic, as some add-ons may be bugged and simply not reply in some very specific scenarios, leading to them being killed without a good reason.

An alternative would be adding logic based on number of attempts, in which the request is stopped if the add-on reaches the timeout for the first 2 times it happens, and is killed if it happens a 3rd time.

sungshon commented 5 years ago

This was done, currently killing add-ons if they fail to respond to a request within 120 seconds.

If this logic fails in any way, i will revisit the subject, otherwise i consider it a more then fair amount of time for a response.