Bug#931597: transmission: Lift 1024 open files limit

2021-10-10 Thread Vitaly Potyarkin
> This appears to have been reverted with
>
> https://github.com/transmission/transmission/commit/5d6922f7d6f71001de091272ad61724973c14293

The reversal commit is not part of any branches of upstream Transmission.
I don't know why ckerr needed to revert the changes back in 2020, but it was
most likely just some short-lived experimental branch.

At the moment (2021-10-10) master branch still contains the fix I submitted:

https://github.com/transmission/transmission/blob/a4d7e11a14f16b4bac69b99d4c0da055847b9625/libtransmission/web.cc#L524-L539

It didn't get merged in time for 3.0, but it is merged now and it will almost
definitely be a part of the next Transmission release.
So, the fix will eventually make it into Debian - let's hope that the next
Transmission release will come before Bookworm freeze.

I agree that this bug report should remain closed.
I'm adding this note just to provide correct information regarding the
reversal commit.



Bug#931597: transmission: Lift 1024 open files limit

2020-11-16 Thread Moritz Mühlenhoff
On Mon, Jul 08, 2019 at 08:32:15AM -0400, Sandro Tosi wrote:
> Thanks Vitaly,
> 
> On Mon, Jul 8, 2019 at 1:30 AM Vitaly Potyarkin  wrote:
> > I have submitted this patch upstream several months ago, but the upstream
> > development is rather slow and nobody reacted to my pull request yet. I 
> > suggest
> > adding this fix to the Transmission package in Debian because it is (a) 
> > simple
> > enough and (b) would make a lot of users happy.
> 
> still i would prefer for the upstream maintainers to chime in, before
> diverging in Debian.

Vitaly's patch got merged in 2da97b25fa43948fb24014535e880efed1a2fbdf.

I've smoketested a local build with that commit on top of 3.00-1 and it's
working fine for me (can't test with > 1024 torrents ATM, though). Not sure
if a new upstream release is planned before the freeze, but otherwise it
would be nice to cherrypick that into Bullseye :-)

Cheers,
Moritz



Bug#931597: transmission: Lift 1024 open files limit

2019-07-08 Thread Vitaly Potyarkin
Ok, that's understandable.


Bug#931597: transmission: Lift 1024 open files limit

2019-07-08 Thread Sandro Tosi
Thanks Vitaly,

On Mon, Jul 8, 2019 at 1:30 AM Vitaly Potyarkin  wrote:
> I have submitted this patch upstream several months ago, but the upstream
> development is rather slow and nobody reacted to my pull request yet. I 
> suggest
> adding this fix to the Transmission package in Debian because it is (a) simple
> enough and (b) would make a lot of users happy.

still i would prefer for the upstream maintainers to chime in, before
diverging in Debian.

-- 
Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
G+: https://plus.google.com/u/0/+SandroTosi



Bug#931597: transmission: Lift 1024 open files limit

2019-07-07 Thread Vitaly Potyarkin
Package: transmission
Version: 2.94-2
Severity: wishlist
Tags: upstream patch

For a long time Transmission has had a hardcoded limit for the number of open
files. It was set to the value of FD_SETSIZE, which is usually 1024 on most
systems.

The hardcoded value was not enough for some of heavy use cases, and many users
have voiced their displeasure with the current situation. I suggest a patch
that fixes the issue because of which the limitation was added to Transmission
in the first place. Attached patch has been tested against Transmission 2.94
that is currently available from Buster repos.

I have submitted this patch upstream several months ago, but the upstream
development is rather slow and nobody reacted to my pull request yet. I suggest
adding this fix to the Transmission package in Debian because it is (a) simple
enough and (b) would make a lot of users happy. If the maintainer decides
`debian/patches` is not a suitable place to distribute this patch the page at
b.d.o will still be useful as a reference for those interested in fixing the
NOFILE limit in Transmission.

Links:

- Pull request to upstream:
  
- Initial issue where the limitation was first introduced:
  
- Reports from users unhappy with the current situation:
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
>From 907f368360ae8514e7d4652b999a00a3cf9c6741 Mon Sep 17 00:00:00 2001
From: Vitaly Potyarkin 
Date: Fri, 14 Jun 2019 14:49:26 +0300
Subject: [PATCH] Lift 1024 open files limit (switch to curl polling API)

Backported from https://github.com/transmission/transmission/pull/893
---
 CMakeLists.txt|  2 +-
 configure.ac  |  2 +-
 libtransmission/fdlimit.c | 22 
 libtransmission/web.c | 74 ++-
 4 files changed, 20 insertions(+), 80 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index da28e31..c2e4ec2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,7 +94,7 @@ string(SUBSTRING "${TR_VCS_REVISION}" 0 10 TR_VCS_REVISION)
 
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
-set(CURL_MINIMUM7.15.4)
+set(CURL_MINIMUM7.28.0)
 set(EVENT2_MINIMUM  2.0.10)
 set(OPENSSL_MINIMUM 0.9.7)
 set(CYASSL_MINIMUM  3.0)
diff --git a/configure.ac b/configure.ac
index df8cb50..277db00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,7 @@ AM_CONDITIONAL(HAVE_REVISION_FILE, test -f REVISION)
 ##
 ##
 
-CURL_MINIMUM=7.15.4
+CURL_MINIMUM=7.28.0
 AC_SUBST(CURL_MINIMUM)
 LIBEVENT_MINIMUM=2.0.10
 AC_SUBST(LIBEVENT_MINIMUM)
diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c
index e181e53..17c28d0 100644
--- a/libtransmission/fdlimit.c
+++ b/libtransmission/fdlimit.c
@@ -12,11 +12,6 @@
 #include 
 #include 
 
-#ifndef _WIN32
- #include  /* getrlimit */
- #include  /* getrlimit */
-#endif
-
 #include "transmission.h"
 #include "error.h"
 #include "error-types.h"
@@ -364,23 +359,6 @@ ensureSessionFdInfoExists (tr_session * session)
   i = tr_new0 (struct tr_fdInfo, 1);
   fileset_construct (&i->fileset, FILE_CACHE_SIZE);
   session->fdInfo = i;
-
-#ifndef _WIN32
-  /* set the open-file limit to the largest safe size wrt FD_SETSIZE */
-  struct rlimit limit;
-  if (!getrlimit (RLIMIT_NOFILE, &limit))
-{
-  const int old_limit = (int) limit.rlim_cur;
-  const int new_limit = MIN (limit.rlim_max, FD_SETSIZE);
-  if (new_limit != old_limit)
-{
-  limit.rlim_cur = new_limit;
-  setrlimit (RLIMIT_NOFILE, &limit);
-  getrlimit (RLIMIT_NOFILE, &limit);
-  tr_logAddInfo ("Changed open file limit from %d to %d", 
old_limit, (int)limit.rlim_cur);
-}
-}
-#endif
 }
 }
 
diff --git a/libtransmission/web.c b/libtransmission/web.c
index c7f0627..65c1d09 100644
--- a/libtransmission/web.c
+++ b/libtransmission/web.c
@@ -10,12 +10,6 @@
 #include 
 #include  /* strlen (), strstr () */
 
-#ifdef _WIN32
-  #include 
-#else
-  #include 
-#endif
-
 #include 
 
 #include 
@@ -334,41 +328,6 @