tomohisaota/fluent-plugin-tail-multiline — pull request #1 by kozy4324 (2013-07-12 02:59:34+00:00)
Title: Fix race condition error

`Thread.new` execute the passed code block immediately. When the code block
run before `#initExecBlock`, `@exec_time - now`([L154](https://github.com/tomohisaota/fluent-plugin-tail-multiline/blob/master/lib/fluent/plugin/in_tail_multiline.rb#L154)) will throw NoMethodError
because `@exec_time` is `nil`.

In this error occured, the error log appear as below.

```
undefined method `-' for nil:NilClass
2013-07-12 11:33:26 +0900 [error]: killed thread
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluent-plugin-tail-multiline/lib/fluent/plugin/in_tail_multiline.rb:139:in `run'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluent-plugin-tail-multiline/lib/fluent/plugin/in_tail_multiline.rb:139:in `call_later'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluent-plugin-tail-multiline/lib/fluent/plugin/in_tail_multiline.rb:89:in `receive_lines'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:324:in `call'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:324:in `on_notify'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:155:in `on_notify'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:245:in `call'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:245:in `on_timer'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/cool.io-1.1.0/lib/cool.io/loop.rb:96:in `run_once'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/cool.io-1.1.0/lib/cool.io/loop.rb:96:in `run'
2013-07-12 11:33:26 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:83:in `run'
2013-07-12 11:33:27 +0900 [error]: closed stream
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:307:in `read_nonblock'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:307:in `on_notify'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:155:in `on_notify'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:245:in `call'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:245:in `on_timer'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/cool.io-1.1.0/lib/cool.io/loop.rb:96:in `run_once'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/cool.io-1.1.0/lib/cool.io/loop.rb:96:in `run'
2013-07-12 11:33:27 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:83:in `run'
2013-07-12 11:33:28 +0900 [error]: closed stream
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:309:in `read_nonblock'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:309:in `on_notify'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:155:in `on_notify'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:245:in `call'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:245:in `on_timer'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/cool.io-1.1.0/lib/cool.io/loop.rb:96:in `run_once'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/cool.io-1.1.0/lib/cool.io/loop.rb:96:in `run'
2013-07-12 11:33:28 +0900 [error]: /Users/kozy4324/ruby_work/fluentd/vendor/bundle/ruby/1.9.1/gems/fluentd-0.10.35/lib/fluent/plugin/in_tail.rb:83:in `run'
```