Project

General

Profile

Actions

Bug #6705

closed

[API] Websockets denial of service requesting past logs

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

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
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/2015Actions
Task #6714: FixResolvedPeter Amstutz07/23/2015Actions
Actions #1

Updated by Peter Amstutz over 8 years ago

  • Description updated (diff)

If

Actions #2

Updated by Peter Amstutz over 8 years ago

  • Story points set to 0.5
Actions #3

Updated by Peter Amstutz over 8 years ago

  • Target version changed from Bug Triage to 2015-08-05 sprint
Actions #4

Updated by Peter Amstutz over 8 years ago

  • Assigned To set to Peter Amstutz
Actions #5

Updated by Radhika Chippada over 8 years ago

  • Status changed from New to In Progress

LGTM

Actions #6

Updated by Peter Amstutz over 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Applied in changeset arvados|commit:2ab08e38376d9591394d35d7676badf96f7b99c9.

Actions

Also available in: Atom PDF