rails-profiler 0.44.5 → 0.44.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,7 +87,8 @@ module Profiler
87
87
  def post(uri, body)
88
88
  Profiler.untracked_http do
89
89
  Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https",
90
- open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT) do |http|
90
+ open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT,
91
+ write_timeout: READ_TIMEOUT) do |http|
91
92
  http.post(uri.request_uri, body, request_headers)
92
93
  end
93
94
  end
@@ -135,12 +136,22 @@ module Profiler
135
136
  rescue => e
136
137
  @registered = false
137
138
  @failed = true
138
- log_warn("communication with the master failed, will retry", e)
139
+ if configuration_error?(e)
140
+ Profiler.log_error_once(:cluster_config, "Cluster: communication with the master failed due to configuration", e)
141
+ else
142
+ log_warn("communication with the master failed, will retry", e)
143
+ end
139
144
  ensure
140
145
  sleep interval
141
146
  end
142
147
  end
143
148
 
149
+ # True when the error is a permanent configuration problem that will not resolve by retrying.
150
+ def configuration_error?(error)
151
+ message = error.message.to_s
152
+ message.start_with?("master_url") || message.include?("secret")
153
+ end
154
+
144
155
  def log_info(msg)
145
156
  Profiler.log_info("Cluster: #{msg}")
146
157
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Profiler
4
- VERSION = "0.44.5"
4
+ VERSION = "0.44.7"
5
5
 
6
6
  GEM_ROOT = File.expand_path("../..", __dir__)
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.5
4
+ version: 0.44.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Duplessy