Opened 12 years ago

Closed 12 years ago

#2987 closed Enhancement (fixed)

push libcurl into its own worker thread

Reported by: charles Owned by: charles
Priority: Normal Milestone: 1.92
Component: libtransmission Version: 1.91
Severity: Normal Keywords:
Cc:

Description (last modified by charles)

Transmission has been fighting libcurl for a long time. We're using the lesser-used API for letting remote code (in this case, libevent) drive curl's event system. This tends to magnify bugs in older versions of libcurl and libevent that ship on some OSes and distros. And because it's more complicated ,there have been a fair number of bugs caused by Transmission's glue code too.

Also, because many systems don't build nonblocking DNS resolution into libcurl, and because we run libcurl in the libtransmission thread, we have some ugly, ugly hacks in the glue code to do our own nonblocking DNS and cache the results ourselves. This code caused most of the 1.8x bugfix releases.

When someone complains about slow tracker announces on some random platform the development team doesn't have access to, it's hard to know whether to chalk it up to random chance or a bug in our libcurl+libevent glue code.

Instead of continuing to roll that particular ball uphill, let's use libcurl's multi interface the same way most projects do -- in its own thread with curl_multi_fdset + curl_multi_timeout + select + curl_multi_perform

Doing this would have several benefits:

  • Reduce the bugs caused from old versions of libevent
  • Reduce the bugs caused from old versions of libcurl
  • Reduce the bugs caused by me ;)
  • Transmission's minimum version of libcurl would drop to 7.15.4 (June 2006) when curl_multi_timeout() was introduced, making life easier for users running Transmission on stable (old) distros like CentOS and older Debian systems

Attachments (1)

web.diff (29.8 KB) - added by charles 12 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 12 years ago by charles

  • Status changed from new to assigned

Changed 12 years ago by charles

comment:2 Changed 12 years ago by charles

  • Description modified (diff)

comment:3 Changed 12 years ago by charles

  • Milestone changed from 2.00 to Sometime

comment:4 Changed 12 years ago by charles

I've been running this with no problems for a week now, so I'll put it into trunk for wider testing in the nightlies

comment:5 Changed 12 years ago by charles

Committed to trunk in r10303

comment:6 Changed 12 years ago by charles

...and tweaked in r10304 :)

comment:7 Changed 12 years ago by charles

...and fix a bug in r10306 :(

comment:8 Changed 12 years ago by charles

  • Description modified (diff)

comment:9 Changed 12 years ago by charles

  • Milestone changed from Sometime to 1.92

comment:10 Changed 12 years ago by charles

lowered the minimum curl version from 7.16.3 to 7.15.4:

1.9x: r10338

trunk: r10339

comment:11 Changed 12 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.