pupnp
pupnp copied to clipboard
too many jobstotal jobs = 100
In RetroShare we use libupnp for getting external IP address and to forward ports on NAT, we often receive reports of the log being flooded by messages like this one
too many jobstotal jobs = 100
Finally it happened to me too so I was able to track down it came from libupnp
https://github.com/pupnp/pupnp/blob/master/upnp/src/threadutil/ThreadPool.c#L825
Moreover it seems that the more UPnP enabled devices are in the same network the more it is likely for this to happen, I suppose that sadly log flooding is not the only consequence.
So first of all an easy fix so it less likely to mangle other messages is to add a \n at the end of the message. Also to make it easier to understand for others it comes from libupnp it would be nice to prefix the message with something like "libupnp ThreadPoolAdd". And finally then it would be really helpful to print a stacktrace when this happens, so one can get an indication if this problem is triggered by library user code, you can find snippets of how to print a stacktrace in C++ easily on the internet, you can even adapt the code from RetroShare
https://github.com/RetroShare/RetroShare/blob/master/libretroshare/src/util/stacktrace.h
Cheers, and thanks for caring of libupnp ♡
First question of course is, which version of libupnp are you running, and can you confirm this behavour with the latest 1.12.1 version?
It happened with a few versions of the 1.6.x series, now I am compiling with 1.12.1 from gentoo repository to see If I can reproduce the problem there, in any case I think the improvements on the message that could be eventually be printed should be done anyway, would you accept a pull request improving on that?
There was some discussion in 2017 about this issue: #29
There was some discussion in 2017 about this issue: #29
Yeah I read that before but seems it is not related to our case, I have been inspecting our code and it seems very unlikely that we are calling some Upnp* function in a loop.
I can confirm this still happens with libupnp-1.12.1 after half an hour of running my log started being mangled with total jobs = 100, too many jobstotal jobs = 100, too many jobstotal jobs = 100, too many jobs
I have opened a PR so at least the message is easier to track and avoid mangling other messages in the log https://github.com/pupnp/pupnp/pull/179
Hi G10h4ck,
Can you try running configure with --disable-blocking_tcp_connections ?
Regards, Marcelo.
Hi G10h4ck,
Can you try running configure with --disable-blocking_tcp_connections ?
Regards, Marcelo.
It is already compiled by default with that option on gentoo, and in installation it have this gentoo flags Installed versions: 1.12.1(10:16:41 AM 06/03/2020)(ipv6 reuseaddr -blocking-tcp -debug -doc -samples -static-libs)
In particular -blocking-tcp means --disable-blocking_tcp_connections