bmegli / ev3dev-mapping

The ev3dev-mapping project meta repository
http://www.ev3dev.org/projects/2016/08/07/Mapping/
16 stars 6 forks source link

Kill misbehaving children #28

Closed bmegli closed 7 years ago

bmegli commented 7 years ago

It can happen that misbehaving module (on EV3) is stuck on blocking IO (e.g. laser waititing for synchronization without running motor properly) and will not know that it's stdin was closed by ev3control.

This way request from ev3control to disable module will wait indefinitely.

Give some timeout for child to close and if it is naughty kill it with a signal.

A child will get SIGINT in IO call and finish gracefully (at least this is what modules already do on SIGINT in most cases).

So:

Optionally if it's still misbehaving after that kill it mercilessly

bmegli commented 7 years ago

Implementation Plan

Other info

Initally: MODULE_DISABLE_TRIES=3 MODULE_DISABLE_MS=50