Opened 7 years ago

Closed 5 years ago

#6031 closed Bug (fixed)

setInterval()-based polling causes problems if client struggles to respond them in time

Reported by: WGH Owned by: mike.dld
Priority: Normal Milestone: 3.00
Component: Web Client Version: 2.84
Severity: Normal Keywords: patch


If Transmission server can't respond to AJAX-based requests in refresh interval, the web browser will issue another one before it gets an answer for the current one.

Basically, queue of pending AJAX requests will grow indefinitely, rendering the web UI useless after quite a short time.

The fix would be to never use setInterval for such things. Use setTimeout instead, and set a new timer only after receiving response from the server.

(If you're wondering how I discovered this: I loaded 1+ TB torrent on first generation Raspberry Pi, with torrent files being on NTFS-3g mounted external hard drive).

Attachments (2)

transmission_setInterval_patch.diff (3.5 KB) - added by WGH 7 years ago.
transmission_setInterval_patch_v2.diff (4.0 KB) - added by WGH 6 years ago.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by WGH

comment:1 Changed 7 years ago by WGH

The attached patch (currently pending moderation) solves this.

comment:2 Changed 7 years ago by zp_

Just a heads up, the setTimeout functions are in the wrong order in transmission.js (msec before callback)

Also, the inspector.js changes don't seem to function (at least for me), the peers/files tab don't update their data, unless you switch to a different torrent and back again (and it's only a 1 time update for the initial switch)

Changed 6 years ago by WGH

comment:3 Changed 6 years ago by WGH

Thank you for reviewing my patch.

I've fixed both issues you mentioned, and actually verified that everything works.

comment:4 Changed 6 years ago by Robby

  • Keywords patch added

comment:5 Changed 6 years ago by mike.dld

  • Milestone changed from None Set to 3.00

comment:6 Changed 5 years ago by mike.dld

  • Owner set to mike.dld
  • Status changed from new to assigned

comment:7 Changed 5 years ago by mike.dld

  • Resolution set to fixed
  • Status changed from assigned to closed

Committed as a3654c65a59f4a386ca566dde2d8c713cf0136b1.

Note: See TracTickets for help on using tickets.