Skip to content

Commit

Permalink
Fix Uncaught exception: can't dump IO (#5022)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy committed Oct 13, 2021
1 parent 06d43cb commit 1f05bd6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/sidekiq/redis_connection.rb
Expand Up @@ -94,12 +94,10 @@ def client_opts(options)
def log_info(options)
redacted = "REDACTED"

# deep clone so we can muck with these options all we want
#
# exclude SSL params from dump-and-load because some information isn't
# safely dumpable in current Rubies
keys = options.keys
keys.delete(:ssl_params)
# Deep clone so we can muck with these options all we want and exclude
# params from dump-and-load that may contain objects that Marshal is
# unable to safely dump.
keys = options.keys - [:logger, :ssl_params]
scrubbed_options = Marshal.load(Marshal.dump(options.slice(*keys)))
if scrubbed_options[:url] && (uri = URI.parse(scrubbed_options[:url])) && uri.password
uri.password = redacted
Expand Down

0 comments on commit 1f05bd6

Please sign in to comment.