fluent/fluentd — pull request #347 by repeatedly (2014-06-13 08:30:52+00:00)
Title: Serialize plugin shutdown order. Shutdown Input first for safety

This is a testbed for `shutdown` improvement.
Current `Engine#shutdown` calles plugin's `shutdown` in parallel.
The merit is fast shutdown and it works on almost cases, but it has one problem that output plugin may be closed before input plugin shutdown.

To resolve the problem, calling input shutdown before output shutdown fix the problem.
The demerit is taking more time to shutdown Fluentd if input and output have long time shutdown.

In addition, I consider adding timeout to each plugin shutdown.
For keeping compatibility, default is no timeout but add `--shutdown-timeout SECONDS` like option to Fluentd.

What do you think?