我们有一个后台sidekiq作业,平均每小时运行约100次。这项工作只是合并从S3存储桶中提取的PDF。最近(在上个月内)它有时会开始失效。我们正在使用回形针,而这是炸开open(report.expiring_url(3600)).read
的代码行。
浏览日志,此行成功操作的时间戳通常不到半秒。但是,当它失败时,总是超过10秒。当我手动打开有问题的网址时,它加载得很好,而且不是一个大文件。
我们得到的错误几乎没有用,我想知道是否有任何方法可以收集更多信息。
2020-06-24T10:15:32.264Z 20452 TID-goex23120 WARN: Errno::ECONNRESET: Connection reset by peer - SSL_connect
2020-06-24T10:15:32.264Z 20452 TID-goex23120 WARN: /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/protocol.rb:44:in `ssl_socket_connect'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:981:in `connect'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:909:in `start'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:609:in `start'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:485:in `get_response'
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/net/http.rb:462:in `get'
/var/app/current/app/workers/combine_test_reports.rb:29:in `block (2 levels) in perform'
/var/app/current/app/workers/combine_test_reports.rb:16:in `each'
/var/app/current/app/workers/combine_test_reports.rb:16:in `block in perform'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.2/lib/active_support/core_ext/time/zones.rb:64:in `use_zone'
/var/app/current/app/workers/combine_test_reports.rb:12:in `perform'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:167:in `execute_job'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:139:in `block (5 levels) in process'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/rails.rb:90:in `block in call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.2/lib/active_support/execution_wrapper.rb:85:in `wrap'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/rails.rb:89:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:135:in `block (4 levels) in process'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sentry-raven-2.13.0/lib/raven/integrations/sidekiq.rb:9:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-unique-jobs-5.0.10/lib/sidekiq_unique_jobs/server/middleware.rb:17:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-pro-3.7.1/lib/sidekiq/batch/middleware.rb:54:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/server/logging.rb:10:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/var/app/current/vendor/cache/acts_as_tenant-118aab88b67d/lib/acts_as_tenant/sidekiq.rb:21:in `block in call'
/var/app/current/vendor/cache/acts_as_tenant-118aab88b67d/lib/acts_as_tenant/model_extensions.rb:56:in `with_tenant'
/var/app/current/vendor/cache/acts_as_tenant-118aab88b67d/lib/acts_as_tenant/sidekiq.rb:20:in `call'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:134:in `block (3 levels) in process'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/logging.rb:32:in `with_context'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:132:in `block (2 levels) in process'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:183:in `stats'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:131:in `block in process'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq.rb:35:in `block in <module:Sidekiq>'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:126:in `process'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:82:in `process_one'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:70:in `run'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/util.rb:17:in `watchdog'
/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/sidekiq-4.2.10/lib/sidekiq/util.rb:26:in `block in safe_thread'