Skip to content
Snippets Groups Projects
Unverified Commit 1a747f70 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix statsd UDP sockets not being cleaned up in Sidekiq (#11230)

parent bc60d794
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,11 @@
class SidekiqErrorHandler
def call(*)
yield
rescue Mastodon::HostValidationError => e
Rails.logger.error "#{e.class}: #{e.message}"
Rails.logger.error e.backtrace.join("\n")
rescue Mastodon::HostValidationError
# Do not retry
ensure
socket = Thread.current[:statsd_socket]
socket&.close
Thread.current[:statsd_socket] = nil
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment