https://bugs.kde.org/show_bug.cgi?id=474231

Harald Sitter <sit...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
                   |ma/discover/-/commit/db0ebc |ma/discover/-/commit/46d145
                   |855517f189f64c1602a5d27e185 |15c3105e4e318d28db41057d9f1
                   |cf02833                     |df3ce4d

--- Comment #3 from Harald Sitter <sit...@kde.org> ---
Git commit 46d14515c3105e4e318d28db41057d9f1df3ce4d by Harald Sitter.
Committed on 13/09/2023 at 09:19.
Pushed by sitter into branch 'Plasma/5.27'.

flatpak: make FlatpakTransactionThread a qrunnable instead

we can't just have an unlimited number of threads for flatpak
transactions. it'd eventually cause excessive load on both CPU and
network to the point where things will start misbehaving. we also run
risk of exhausting other software limited resources such as file
descriptors.

to resolve this problem we now treat the transactionthread as runnable
and put it in a limited threadpool for concurrent execution. the new
runnable has a finished signal that is emitted on every return from
run() to match the QThread API.

concurrency is limited to no more than 4 runnables at a time. that
should still be plenty concurrent while generally unexpected to exhaust
the default 1024 file descriptor limit - an install transaction appears
to weigh between 60 and 100 fds

other backends don't necessarily have this problem since they have
daemons that do the work for us so we have way fewer open fds for them.

(cherry picked from commit db0ebc855517f189f64c1602a5d27e185cf02833)

M  +29   -5    libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.cpp
M  +7    -2    libdiscover/backends/FlatpakBackend/FlatpakTransactionThread.cpp
M  +4    -1    libdiscover/backends/FlatpakBackend/FlatpakTransactionThread.h

https://invent.kde.org/plasma/discover/-/commit/46d14515c3105e4e318d28db41057d9f1df3ce4d

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to