Sha256: 4fb64be57b7a83621f9e29ab67c267c726daec531f27aabf7a21a820c61e1740

Contents?: true

Size: 962 Bytes

Versions: 40

Compression:

Stored size: 962 Bytes

Contents

module AgentHooks
  # Used post fork to re-initialize state and restart communications with
  # the host agent.
  #
  def after_fork
    ::Instana.logger.debug "after_fork hook called. Falling back to unannounced state and spawning a new background agent thread."

    @timers.cancel

    # Reseed the random number generator for this
    # new thread.
    srand

    transition_to(:unannounced)

    setup
    spawn_background_thread
  end

  def before_resque_fork
    ::Instana.logger.debug "before_resque_fork hook called. pid/ppid: #{Process.pid}/#{Process.ppid}"
    @is_resque_worker = true
  end

  def after_resque_fork
    ::Instana.logger.debug "after_resque_fork hook called. pid/ppid: #{Process.pid}/#{Process.ppid}"

    @timers.cancel

    # Reseed the random number generator for this
    # new thread.
    srand

    ::Instana.config[:metrics][:enabled] = false

    @process[:pid] = Process.pid

    setup
    spawn_background_thread
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
instana-1.193.4 lib/instana/agent/hooks.rb
instana-1.193.3 lib/instana/agent/hooks.rb
instana-1.193.3.pre1 lib/instana/agent/hooks.rb
instana-1.193.2 lib/instana/agent/hooks.rb
instana-1.192.1 lib/instana/agent/hooks.rb
instana-1.192.0 lib/instana/agent/hooks.rb
instana-1.13.0 lib/instana/agent/hooks.rb
instana-1.12.0 lib/instana/agent/hooks.rb
instana-1.11.8-java lib/instana/agent/hooks.rb
instana-1.11.8 lib/instana/agent/hooks.rb
instana-1.11.7 lib/instana/agent/hooks.rb
instana-1.11.6 lib/instana/agent/hooks.rb
instana-1.11.6-java lib/instana/agent/hooks.rb
instana-1.11.5 lib/instana/agent/hooks.rb
instana-1.11.5-java lib/instana/agent/hooks.rb
instana-1.11.4-java lib/instana/agent/hooks.rb
instana-1.11.4 lib/instana/agent/hooks.rb
instana-1.11.3-java lib/instana/agent/hooks.rb
instana-1.11.3 lib/instana/agent/hooks.rb
instana-1.11.2-java lib/instana/agent/hooks.rb