Gungho::Plugin::Apoptosis - Stop Execution In Long-Running Processes


    - module: Apoptosis
        timeout: 86400 # Stop execution after 1 day


Gungho is usually used in a environment where the processes survive a long time.

Sometimes this leads the application to consume too much memory - Yes, a memory leak! The memory leak can reside both in Gungho or your particular Provider/Handler logic. If you or I can fix it, good. But usually memory leaks are just darn hard to find, and you know your application won't acquire that much garbage in, say, 1 day.

I this case you just want to stop the execution of your crawler, and perhaps replace it by another process.

This plugin takes care of killing the running crawler process after a certain amount of time. When it reaches the timeout specified in the config, then the global "is_running" flag is set to off. After this flag is off, Gungho will not dispatch any more requests, and waits for other states to finish, eventually leading it to stop.

At this point you can re-dispatch your crawler proceses the way you want to.