We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using Sidekiq to process my APNS push background jobs. I am using APNS as the code below
APNS.host = 'gateway.push.apple.com' APNS.port = 2195 APNS.pem = '<pem credential file path here>' APNS.pass = '' message = "new message" APNS.send_notification('<device token here>', alert: message, :other => {:type => 'requested_order', :key => 'order_id', :value => 1})
However, I often get my push workers stuck in Sidekiq. With a sidekiq dump, I get the following info:
2016-03-15T13:07:52.728Z 7483 TID-gryn4hvgw WARN: Thread TID-gryne1v0o 2016-03-15T13:07:52.728Z 7483 TID-gryn4hvgw WARN: /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:41:in `synchronize' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:41:in `send_notifications' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:37:in `send_notification' /var/app/current/app/workers/stepped_order_request_notification_worker.rb:54:in `block in perform' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/activerecord-4.1.6/lib/active_record/relation/delegation.rb:46:in `each' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/activerecord-4.1.6/lib/active_record/relation/delegation.rb:46:in `each' /var/app/current/app/workers/stepped_order_request_notification_worker.rb:49:in `perform' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:75:in `execute_job' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:52:in `block (2 levels) in process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:127:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:127:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidetiq-0.6.3/lib/sidetiq/middleware/history.rb:8:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/logging.rb:24:in `with_context' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/logging.rb:7:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:132:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:132:in `invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:51:in `block in process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:98:in `stats' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:50:in `process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create' 2016-03-15T13:07:52.728Z 7483 TID-gryn4hvgw WARN: Thread TID-gryne1cu8 2016-03-15T13:07:52.728Z 7483 TID-gryn4hvgw WARN: /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:41:in `synchronize' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:41:in `send_notifications' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:37:in `send_notification' /var/app/current/app/workers/order_start_notification_worker.rb:41:in `block in perform' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/activerecord-4.1.6/lib/active_record/relation/delegation.rb:46:in `each' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/activerecord-4.1.6/lib/active_record/relation/delegation.rb:46:in `each' /var/app/current/app/workers/order_start_notification_worker.rb:40:in `perform' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:75:in `execute_job' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:52:in `block (2 levels) in process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:127:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:127:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidetiq-0.6.3/lib/sidetiq/middleware/history.rb:8:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/logging.rb:24:in `with_context' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/logging.rb:7:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:132:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:132:in `invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:51:in `block in process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:98:in `stats' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:50:in `process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create' 2016-03-15T13:07:52.729Z 7483 TID-gryn4hvgw WARN: Thread TID-gryne02ek 2016-03-15T13:07:52.729Z 7483 TID-gryn4hvgw WARN: /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:41:in `synchronize' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:41:in `send_notifications' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/pushmeup-0.3.0/lib/pushmeup/apns/core.rb:37:in `send_notification' /var/app/current/app/workers/order_start_notification_worker.rb:41:in `block in perform' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/activerecord-4.1.6/lib/active_record/relation/delegation.rb:46:in `each' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/activerecord-4.1.6/lib/active_record/relation/delegation.rb:46:in `each' /var/app/current/app/workers/order_start_notification_worker.rb:40:in `perform' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:75:in `execute_job' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:52:in `block (2 levels) in process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:127:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:127:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidetiq-0.6.3/lib/sidetiq/middleware/history.rb:8:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/logging.rb:24:in `with_context' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/server/logging.rb:7:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:129:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:132:in `call' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/middleware/chain.rb:132:in `invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:51:in `block in process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:98:in `stats' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/sidekiq-3.3.2/lib/sidekiq/processor.rb:50:in `process' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize' /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
Is it because APNS#send_notification is not thread_safe? What is the thread_safe alternative here?
APNS#send_notification
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using Sidekiq to process my APNS push background jobs. I am using APNS as the code below
However, I often get my push workers stuck in Sidekiq. With a sidekiq dump, I get the following info:
Is it because
APNS#send_notification
is not thread_safe? What is the thread_safe alternative here?The text was updated successfully, but these errors were encountered: