lib/new_relic/agent/agent.rb in newrelic_rpm-3.9.0.229 vs lib/new_relic/agent/agent.rb in newrelic_rpm-3.9.1.236

- old
+ new

@@ -153,11 +153,11 @@ return if !Agent.config[:agent_enabled] || !Agent.config[:monitor_mode] || disconnected? || @worker_thread && @worker_thread.alive? - ::NewRelic::Agent.logger.debug "Starting the worker thread in #{$$} after forking." + ::NewRelic::Agent.logger.debug "Starting the worker thread in #{Process.pid} (parent #{Process.ppid}) after forking." # Clear out locks and stats left over from parent process reset_objects_with_locks drop_buffered_data @@ -757,10 +757,11 @@ :app_name => Agent.config.app_names, :language => 'ruby', :agent_version => NewRelic::VERSION::STRING, :environment => @environment_report, :settings => Agent.config.to_collector_hash, + :high_security => Agent.config[:high_security], } end # Returns connect data passed back from the server def connect_to_server @@ -872,10 +873,12 @@ ::NewRelic::Agent.logger.debug "Connecting Process to New Relic: #$0" query_server_for_configuration @connected_pid = $$ @connect_state = :connected + rescue NewRelic::Agent::ForceDisconnectException => e + handle_force_disconnect(e) rescue NewRelic::Agent::LicenseException => e handle_license_error(e) rescue NewRelic::Agent::UnrecoverableAgentException => e handle_unrecoverable_agent_error(e) rescue StandardError, Timeout::Error, NewRelic::Agent::ServerConnectionException => e @@ -886,9 +889,13 @@ sleep connect_retry_period retry else disconnect end + rescue Exception => e + ::NewRelic::Agent.logger.error "Exception of unexpected type during Agent#connect():", e + + raise end # Who am I? Well, this method can tell you your hostname. def determine_host NewRelic::Agent::Hostname.get