hashbang / irc-bot

IRC Bot
MIT License
3 stars 6 forks source link

Run plugins in separate processes #12

Open daurnimator opened 7 years ago

daurnimator commented 7 years ago

In case a plugin crashes.

RyanSquared commented 7 years ago

Correct me if I'm wrong, but if a plugin "crashes", won't it be fixed the next time it restarts? Because we pass callbacks (instead of a coroutine to iterate over messages), there shouldn't be a reason for a plugin to be reloaded.

KellerFuchs commented 7 years ago

@RyanSquared What if the callback hangs forever?

daurnimator commented 7 years ago

Correct me if I'm wrong, but if a plugin "crashes", won't it be fixed the next time it restarts?

Define "crashes". ==> plugin reload would kill + reap the old process (if it's already dead then it can skip the killing and go straight to reaping) before starting the new process.

RyanSquared commented 7 years ago

@KellerFuchs what if the plugin hangs forever? With the system we have now, the requests are made asynchronously, I believe with a hardcoded timeout.

@daurnimator, I'm asking you to define "crashes":

In case a plugin crashes.

daurnimator commented 7 years ago

With the system we have now, the requests are made asynchronously, I believe with a hardcoded timeout.

No timeout.

@daurnimator, I'm asking you to define "crashes":

"crash" meaning any hang, error or actual crash (e.g. a segfault in a C library) In the current form errors are not caught in plugins; nor are they monitored for hangs/loops/etc. This makes it very un-resilient.

RyanSquared commented 7 years ago

Does lua-http have timeouts? If so, that could help with that issue. As for errors, I can probably write something to handle that as well. With segfaults, I think there might be a more important issue if a plugin segfaults.

daurnimator commented 7 years ago

Does lua-http have timeouts?

It does. but you have to remember to use them :p

Moving each plugin to it's own process eliminates a whole class of issues.