brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.64k stars 114 forks source link

Mysql Connection Issues #58

Closed nagaharish closed 10 years ago

nagaharish commented 10 years ago

Hi, I am using sucker punch for sending the SMS. SMS is going instant but when we are trying to update the status we are getting some exceptions. 40% exceptions are coming and 60% its success for status updation. The below are the errors. ActiveRecord::ConnectionNotEstablished

Errno::EBADF: Bad file descriptor: UPDATE sms_trackers SET status = 0, delivered_on = '2014-05-05 01:18:31', message_transaction_num = '70413992527112954966153'

closed MySQL connection.

Earlier we dont have this issue. Only after using Sucker punch we are getting these exceptions. The below is the code. def perform_sms(sms) begin ActiveRecord::Base.connection_pool.with_connection do SmsProcessor.process_sucker_punch_sms([sms]) end rescue Exception => e p e.to_s end end

Can you please tell me what should be done?

brandonhilkert commented 10 years ago

Bad file descriptors are usually when your database ip/port isn't available. Can you show me your database.yml (without the passwords obviously)?

mattharris5 commented 9 years ago

Was this issue ever solved? I'm experiencing the same issue with what seems to be the same setup (although we aren't sending SMS, just generating some export files).

brandonhilkert commented 9 years ago

I never heard back. Can you show me some code, error messages, and describe your application stack?