问题
class FaxFetchWorker
include Sidekiq::Worker
sidekiq_options :retry => false
def perform(job_id=0)
logger.warn "perform is invoked."
FaxSource.all.each do |source|
...
end
end
end
Getting Error Errno::EIO: Input/output error - <STDOUT>
on Line # 6
回答1:
The #6 line in your code is this
logger.warn "perform is invoked."
This code needs opened STDOUT stream and your error name is Errno::EIO.
In linux EIO means, that there was made an attempt to read/write to stream which is currently unavailable. This could happen because of physical error or when orphaned process (whose parent has died) attempts to get stdio from parent process, or when stream is closed.
回答2:
The workers could be still running in the background but no longer have the access to STDOUT.
I.e. Those workers still keep processing jobs but when it comes to print, they complain about the EIO.
(In my case, it was caused by killing the tmux server WITHOUT killing the workers. Do a ps -ef | grep resque
and there they are.)
Solution:
Kill those workers and start new ones.
e.g. pkill resque-1.25.2
(Or whatever the workers' name)
回答3:
For me restarting redis solved it: service redis restart
来源:https://stackoverflow.com/questions/23820469/errnoeio-input-output-error-stdout