Skip to content

Intermittent errors on nil start time #1

@buermann

Description

@buermann

Occasionally I get the following stack trace from requests passing through grape-middleware-lograge:

error: "can't convert nil into an exact number",
"/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/core_ext/time/calculations.rb:240:in -'", "/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/core_ext/time/calculations.rb:240:in minus_with_duration'",
"/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/core_ext/time/calculations.rb:251:in minus_with_coercion'", "/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:61:in duration'",
"/opt/delta_core/shared/bundle/ruby/2.3.0/bundler/gems/grape-middleware-lograge-3daaa11d7114/lib/grape/middleware/lograge.rb:28:in `block in before'"

Stemming from ActiveSupport::Notifications::Event being initialized with a nil start time from ActiveSupport::Notifications.subscribe('sql.active_record'). The error can be prevented by making sure the value is initialized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions