Commit Graph

139 Commits

Author SHA1 Message Date
Fabio Erculiani f5efd44cc2 [RigoDaemon] acquire UpdatesNotificationResourceLock in non blocking mode
We cannot sleep with the activity mutex held without affecting
parallelism so badly. Otoh, we cannot wleep on UpdatesNotificationResourceLock
without affecting 3rd party clients in a way that we would starve them
for a while. So, try to acquire the file lock in non blocking mode
and if it fails, reschedule a new call as soon as the same lock is
freed (exclusive acquire succeeds). This assumes that if the lock
is held back, we will just re-do the whole trick again and again.
2013-12-26 22:52:12 +01:00
Fabio Erculiani f1a925c220 [solo.commands.install] acquire the notification lock in shared NB mode
This should avoid starvation in the scenario outlined in code comments.
2013-12-26 22:52:12 +01:00
Fabio Erculiani ec198d632b [RigoDaemon] make sure that the serializer is always released
Even in case of exceptions.
2013-12-26 22:52:12 +01:00
Fabio Erculiani bccbce4a34 [RigoDaemon] use UpdatesNotificationResourceLock to avoid signal spam
If this resource lock is acquired, block until the lock is released
so that we will not keep sending status updates to the connected clients
2013-12-26 22:52:12 +01:00
Fabio Erculiani 934a7ce14b [RigoDaemon] drop sleep()
With the new locking strategy, this is no longer necessary
2013-12-26 22:52:12 +01:00
Fabio Erculiani c22f4121f6 [RigoDaemon] use ClientSettings() rather than SystemSettings()[id] 2013-12-12 19:22:42 +01:00
Fabio Erculiani ebf63e6060 [entropy.locks] fix shared/exclusive locking mix due to reentrancy, add tests 2013-12-08 16:15:39 +01:00
Fabio Erculiani 358c6cc80c [entropy.client.repository] drop unlocked_sync(), locking happens externally nowadays 2013-12-08 14:42:23 +01:00
Fabio Erculiani 1917771b54 [entropy.locks] move Entropy Resources Lock code to a separate module 2013-12-08 14:37:57 +01:00
Fabio Erculiani c0776b07bd [RigoDaemon] import the threading module directly 2013-12-08 06:17:15 +01:00
Fabio Erculiani 0f32ae2696 [RigoDaemon] use systemd-logind shutdown/idle Inhibit() API
Inhibit shutdown or idling (see systemd documentation) during
application management or repository update phases.
2013-12-08 06:13:38 +01:00
Fabio Erculiani d8ee468768 [RigoDaemon] add execute_mainloop() wrapper method 2013-12-08 06:13:11 +01:00
Fabio Erculiani e213a5e775 [RigoDaemon] fix regression in api(), the keyword argument must be "sender" 2013-12-07 20:30:07 +01:00
Fabio Erculiani 4e597b8769 [RigoDaemon] use a shared lock with clean_package_cache 2013-12-07 20:30:07 +01:00
Fabio Erculiani 529203ce5a [RigoDaemon] maybe_enqueue_kernel_actions: use simulate 2013-12-07 20:30:06 +01:00
Fabio Erculiani 4f9d8ef61d [RigoDaemon] fixup pylint warnings 2013-12-07 20:30:06 +01:00
Fabio Erculiani 94e07648ec [RigoDaemon] add concurrency support \o/ 2013-12-07 20:30:06 +01:00
Fabio Erculiani d88e33c40c [RigoDaemon] use context manager with ReadersWritersSemaphore 2013-12-07 20:30:06 +01:00
Fabio Erculiani 82b85704ce [entropy.output] make TextInterface methods classmethods
This makes possible to fix a circular dependency in the Entropy
Resources Lock management methods
2013-12-05 21:36:30 +01:00
Fabio Erculiani 7fc8ad14ad [RigoDaemon] add debug output on _authorize callback method 2013-11-29 11:57:57 +01:00
Fabio Erculiani 04048b8818 [RigoDaemon] signal preserved libraries through preserved_libraries_available() 2013-11-29 10:48:50 +01:00
Fabio Erculiani 41e0cf576b [RigoDaemon] migrate to the new PackageActionFactory API 2013-11-23 14:14:48 +01:00
Fabio Erculiani 8c5a499e58 [RigoDaemon] set the default terminal (${TERM}) if unset
This prevents portage phases printing weird things about missing ${TERM}
2013-11-21 21:48:07 +01:00
Fabio Erculiani 3431755aaf [RigoDaemon] do not trigger kernel-switcher if kernel is already installed 2013-11-13 15:36:32 +01:00
Fabio Erculiani 42ab0c38a1 [RigoDaemon] use KernelSwitcher.list() rather than reimplementing the same logic 2013-11-13 13:17:14 +01:00
Fabio Erculiani e93eb24728 [RigoDaemon] implement transparent kernel-switcher support 2013-11-13 13:14:17 +01:00
Fabio Erculiani a323563b22 [RigoDaemon] add "system_restart_needed" signaling 2013-11-05 11:17:32 +01:00
Fabio Erculiani b71ede2b25 [RigoDaemon] implement support for fetch_abort_function
This makes possible to immediately interrupt the download process
2013-11-03 15:39:43 +01:00
Fabio Erculiani a0f684b8ae [RigoDaemon] fix MultipleUrlFetcher stats computation
Also introduce stale data handling.
2013-11-03 14:41:21 +01:00
Fabio Erculiani b1642ac2cb [RigoDaemon] *UrlFetcher: move class variables inside instance 2013-11-03 14:11:22 +01:00
Fabio Erculiani 898a200479 [RigoDaemon] always avoid transfer_output() signal floods 2013-11-03 13:59:18 +01:00
Fabio Erculiani 60febda4f0 [RigoDaemon] add initial One Click Update notification support 2013-11-03 12:57:08 +01:00
Fabio Erculiani 5b9a5ee273 [RigoDaemon] extend updates_available() signal with "One Click Update" information 2013-11-02 14:17:33 +01:00
Fabio Erculiani e02c8da563 [RigoDaemon] fix xml indentation 2013-11-02 14:12:22 +01:00
Fabio Erculiani 79261d5086 [RigoDaemon] increase auto_repositories_update randomization space 2013-10-21 13:08:29 +02:00
Fabio Erculiani 27659c6dc6 [RigoDaemon] drop access() usage 2013-09-18 08:53:44 +02:00
Fabio Erculiani 7ff15f22eb [RigoDaemon] randomize _auto_repositories_update to avoid bursts of requests 2013-06-10 11:07:18 +02:00
Fabio Erculiani d6295b3e00 [entropy*] create const_mkstemp() as tempfile.mkstemp() wrapper.
using /tmp as TMPDIR is a no go, since on modern systems, /tmp is on
tmpfs with a very limited amount of fs size assigned. Use /var/tmp/entropy
(or /var/tmp as fallback) instead.
2013-03-29 12:09:17 +00:00
Fabio Erculiani 73abfc6fa0 [RigoDaemon] schedule a reload every 24 hours to cut on Python leaks. 2013-03-04 13:59:44 +00:00
Fabio Erculiani 7771d641e2 [entropy.client] extend Client.calculate_updates() to return critical updates info
calculate_updates() now returns a dictionary containing the same pieces of
information available before. In addition, it now also returns if critical
updates were found and returned by the method itself.
This is particularly useful for enforcing relaxed deps calculation in case
of critical updates (which is what happens now).

This commit breaks the Entropy Client API.
2013-02-24 13:30:28 +00:00
Fabio Erculiani 1655cb3baa [RigoDaemon] drop send_requested_reply from dbus config, causes deadlock with gdm-3.6 2013-02-12 14:22:56 +01:00
Fabio Erculiani f32ddb95e5 [RigoDaemon] drop any reference to etpUi['debug'] 2012-11-06 20:50:47 +01:00
Fabio Erculiani 280a7067b3 [entropy.cli] drop module, move code to client/ and server/
Even though it is a small code duplication, entropy.cli does make
much less sense.
2012-11-04 21:11:56 +01:00
Fabio Erculiani d9bfa7f11f [RigoDaemon] half the timer frequency and add some randomization in _auto_repositories_update()
When sabayon-weekly is updated, the web service is hit by a huge amount of
requests. This commits add a bit more entropy on the execution of
_auto_repositories_update() (random between 30mins to 2 hours) and reduces
the timer frequency to 8hrs (from 4).
2012-09-08 20:11:22 +02:00
Fabio Erculiani 796e71e9ac [repo] migrate shebangs to /usr/bin/python 2012-08-18 16:53:32 +02:00
Fabio Erculiani d56cd777c8 [RigoDaemon] some minor Python 3.x related fixes 2012-08-18 09:53:18 +02:00
Fabio Erculiani 96976374fe [RigoDaemon] rewrite Installed Repository I/O event handler
Rewrite the serialization code of the I/O events coming in when
the Installed Packages Repository is modified (at filesystem level)
to better deal with bursts of events.
The new code uses a "baton" Semaphore as mutex that can be passed
through threads. The MainThread event handler function tries to
acquire the Semaphore in NB mode, if it does, it spawns a thread
that executes all the operations (acquire locks in blocking mode,
calculate updates, etc) and releases the Semaphore once done.

Olympic win!
2012-08-17 12:27:55 +02:00
Fabio Erculiani c5cf96ace0 [RigoDaemon] delay updates calculation by 20 seconds after locks are released 2012-08-17 11:03:58 +02:00
Fabio Erculiani 89b114f005 [Rigo*] implement mirrors optimization feature, see bug #3438 2012-08-03 16:26:52 +02:00
Fabio Erculiani 107e55a029 [RigoDaemon] fix polkit "Manage Configuration" message field (gnome-polkit guys are idiot!) 2012-08-03 16:17:21 +02:00