Method: Fluent::Plugin::Parser::TimeoutChecker#start

Defined in:
lib/fluent/plugin/parser.rb

#startObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fluent/plugin/parser.rb', line 41

def start
  @thread = ::Thread.new {
    until @flag.wait_for_set(0.5)
      now = Time.now
      @mutex.synchronize {
        @map.keys.each { |th|
          time = @map[th]
          if now - time > @timeout
            th.raise UncatchableError, "parsing timed out"
            @map.delete(th)
          end
        }
      }
    end
  }
end