Project

General

Profile

Actions

Bug #6705

closed

[API] Websockets denial of service requesting past logs

Added by Peter Amstutz over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
07/23/2015
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
0.5

Description

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:

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

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.

        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

Subtasks 2 (0 open2 closed)

Task #6724: Review 6705-fix-websockets-replayResolvedRadhika Chippada07/23/2015

Actions
Task #6714: FixResolvedPeter Amstutz07/23/2015

Actions
Actions

Also available in: Atom PDF