github gotd/td v0.167.2

33 minutes ago

Uploads with the default settings of v0.167.0 and v0.167.1 could fail: fixed, and a faster uploader.

Fixes

The uploader keeps 1 MiB in flight per connection (#2012)

  • Since v0.167.0 the uploader kept 8 MiB of parts in flight by default on the connection of its client, usually the primary one. Telegram may close a connection with that much in flight with transport error -429 (transport flood): uploads failed within 2–3 s with engine forcibly closed. Now as many parts as fit into 1 MiB are in flight by default, as kMaxUploadPerSession of Telegram Desktop. WithThreads still sets it; keep threads × part size within 1 MiB per connection.

Features

Client.Uploader() (#2012)

  • Returns an uploader that sends parts through a pool of Options.UploadPoolSize (default 8) connections to the home DC, one part per connection, as the upload sessions of Telegram Desktop. Uses the primary session and the client middlewares; the pool closes when Run returns and shows as kind upload in gotd.client.pools.
  • Measured on production from a server, 512 MiB with 512 KiB parts: 20.6 MiB/s over client.API(), 41.8 MiB/s with client.Uploader().

Full Changelog: v0.167.1...v0.167.2

Don't miss a new td release

NewReleases is sending notifications on new releases.