You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an EM.error_handler is introduced that does not call EM.stop (e.g., it just logs an error and allows EM.run loop to continue), a task that fails and is caught by this error_handler is run repeatedly and no other deferred tasks get run.
This is due to code in EventMachine#run_deferred_callbacks that does not remove callbacks from @next_tick_queue if there is a failure when executing the callback. This code failure is not caught in test_error_handler because the test error_handler calls EM.stop.
The run_deferred_callbacks method was patched as follows to fix this problem:
def self.run_deferred_callbacks
until (@resultqueue ||= []).empty?
result,cback = @resultqueue.pop
cback.call result if cback
end
@next_tick_queue ||= []
if (l = @next_tick_queue.length) > 0
l.times { cback=@next_tick_queue.shift and cback.call }
end
end
The text was updated successfully, but these errors were encountered:
Testing this bug in EventMachine 1.0.0.beta.3 shows that this is no longer the case. EventMachine#run_deferred_callbacks now removes callbacks from the @next_tick_queue before calling them.
Unfortunately you get a different problem (as described in #185) but I think this bug as described is no longer an issue.
If an EM.error_handler is introduced that does not call EM.stop (e.g., it just logs an error and allows EM.run loop to continue), a task that fails and is caught by this error_handler is run repeatedly and no other deferred tasks get run.
This is due to code in EventMachine#run_deferred_callbacks that does not remove callbacks from @next_tick_queue if there is a failure when executing the callback. This code failure is not caught in test_error_handler because the test error_handler calls EM.stop.
The run_deferred_callbacks method was patched as follows to fix this problem:
The text was updated successfully, but these errors were encountered: