Project

General

Profile

Bug #6705

Updated by Peter Amstutz almost 9 years ago

If a user connects to websockets and provides last_log_id = 1, websockets will replay all logs matching the filter from the beginning of time.    Unfortunately, while it is doing that, it stops responding to every other interaction as well. 

 It sometimes crashes with a stack overflow: 

 <pre> 
 /home/peter/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15: stack level too deep (SystemStackError) 
 </pre> 

 It's already supposed to break up sending the backlog in chunks to avoid this exact problem, so my suspicion is that EventMachine is being silly and executing @push_events@ immediately from @schedule@ instead of the intended behavior of queuing the task until the next turn of the event loop. 

 <pre> 
         if count == limit 
           # Number of rows returned was capped by limit(), we need to schedule 
           # another query to get more logs (will start from last_log_id 
           # reported by current query) 
           EventMachine::schedule do 
             push_events ws, nil 
           end 
 </pre>

Back