Commit Graph

86 Commits

Author SHA1 Message Date
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 b5b8d25297 [RigoDaemon] add support for Action Queue "introspection" (in a MVCC way)
The new action_queue_items() is able to return the internal
Action Queue status without blocking while returning a consistent
state. This method will be used by Rigo to list the Action Queue
activity on the bottom notification box.
2012-07-31 16:35:38 +02:00
Fabio Erculiani e432a1c9f0 [RigoDaemon] make sure to always call Package.kill() 2012-07-27 21:37:48 +02:00
Fabio Erculiani 7135ba3a01 [RigoDaemon] make sure to keep the Installed Packages Repository closed
This helps in case of uncommitted transactions that could cause
any sqlite3 db consumer to lock until timeout with "Database is locked".
2012-07-14 16:10:18 +02:00
Fabio Erculiani b29764443b [Rigo] implement Repository management 2012-07-01 23:41:07 +02:00
Fabio Erculiani 0bd6542a33 [RigoDaemon] be fault-tolerant wrt exceptions happening inside app mgmt worker threads 2012-05-20 21:41:09 +02:00
Fabio Erculiani 8dfe7b435f [RigoDaemon] add thread dumper (as implemented in Rigo) 2012-05-11 06:40:58 +02:00
Fabio Erculiani 5afffbd96d [RigoDaemon] make app management finalization code more robust 2012-04-19 22:59:17 +02:00
Fabio Erculiani 33222698ce [RigoDaemon] only log debug output when --debug is provided 2012-04-19 22:19:50 +02:00
Fabio Erculiani b76ede2ebb [RigoDaemon] fix else branch (regression from previous commit) 2012-04-19 22:15:33 +02:00
Fabio Erculiani c767da88d3 [RigoDaemon] app_log_path can be None, deal with it during app mgmt finalization code 2012-04-19 20:31:58 +02:00
Fabio Erculiani c405b19bdb [RigoDaemon] never flood clients with transfer_output() 2012-04-19 20:31:29 +02:00
Fabio Erculiani 5400519abc [RigoDaemon] feed App Management notes to clients, bump API
Update Rigo as well and let it push the notes to the Terminal Widget
(they come from stdout and stderr, sorry)
2012-04-17 19:53:57 +02:00
Fabio Erculiani 496af68b50 [RigoDaemon] add deferred_shutdown() and shutdown() signals
Both can be used as replacement for the ping/pong protocol in order
to let RigoDaemon shutdown.
This is particularly useful for notification applets, in where holding
RigoDaemon instance is suboptimal.
On the other hand, letting RigoDaemon reload may then cause API
mismatches with these notification applets if they don't reload
as well.
2012-04-16 14:50:40 +02:00
Fabio Erculiani 32914b7f58 [RigoDaemon] always send updates_available, even when no updates are available 2012-04-16 10:26:46 +02:00
Fabio Erculiani 63682a7edb [RigoDaemon] use Gio file monitoring interface instead of plain dnotify 2012-04-16 10:25:39 +02:00
Fabio Erculiani 5fa2dd4780 [RigoDaemon] EINTR can be raised by both OSError and IOError 2012-04-14 13:49:37 +02:00
Fabio Erculiani d59dfb92e4 [RigoDaemon] do not run automatic repositories update if on batteries 2012-04-12 19:44:28 +02:00
Fabio Erculiani a639e417d9 [RigoDaemon] extend updates_available() signal, bump daemon API 2012-04-12 19:38:38 +02:00
Fabio Erculiani 6368528357 [RigoDaemon] add automatic repositories update timer (running every 4 hours) 2012-04-12 18:04:17 +02:00
Fabio Erculiani dab7ea2702 [RigoDaemon] _update_repositories(): make possible to bypass authorization 2012-04-12 18:03:48 +02:00
Fabio Erculiani 0ea3fbf0d8 [RigoDaemon] add docstring to _start_package_cache_timer 2012-04-12 18:03:11 +02:00
Fabio Erculiani 44545691fe [RigoDaemon] add non-blocking, simpler version of _acquire_exclusive() for internal use 2012-04-12 18:00:47 +02:00
Fabio Erculiani 8464be7576 [RigoDaemon] add package cache cleanup timer, running every 8 hours 2012-04-12 16:21:40 +02:00
Fabio Erculiani 890b447785 [RigoDaemon] implement directory monitor for both executable and repositories
This commit adds directory monitor for the Installed Packages
Repository in order to catch, through dnofity, repository change
events and signal repositories_updated() once locks are released.

Given the current Python limitations in supporting dnotify without
getting dirt, DirectoryMonitor dispatches SIGIO to the callback
for both installed repository directory change and RigoDaemon
executable. It is up to the code determine what effectively changed.

Moreover, enabling DN_MULTISHOT causes the signal handler to be
kept alive until the dnotified file descriptors are explicitly closed
(DirectoryMonitor.close()). This is of course sub-optimal because
we get called more than needed, but still much better than polling.
2012-04-12 12:48:44 +02:00
Fabio Erculiani 5f8ca3c6aa [RigoDaemon] fixup several minor bugs 2012-04-12 12:48:44 +02:00
Fabio Erculiani 8a877bbc1b [RigoDaemon] add more debug output 2012-04-11 17:59:42 +02:00
Fabio Erculiani 161f5205d8 [RigoDaemon/Rigo] implement Notice Board support (woot) 2012-04-10 23:37:22 +02:00
Fabio Erculiani c5b55f44c6 [RigoDaemon] if interrupt_activity signal is raised, interrupt both fetch and install phases 2012-04-10 16:29:12 +02:00
Fabio Erculiani 325813243c [RigoDaemon] _send_greetings: keep one and only one thread running the calculation, discard multiple concurrent requests 2012-04-10 13:25:52 +02:00
Fabio Erculiani 7ab432458f [RigoDaemon] split enqueue_application_action() 2012-04-10 12:51:00 +02:00
Fabio Erculiani 065c57ea5b [RigoDaemon] add noticeboards_available() signal 2012-04-10 12:50:43 +02:00
Fabio Erculiani d35d827fc7 [RigoDaemon/Rigo] move startup updates calculation and repo validation to RigoDaemon
Calling RigoDaemon.hello() triggers several welcome signals from
RigoDaemon itself, such as updates availability, repositories aging
and repositories unavailability. This way, Rigo is completely unloaded
with beneficial effects wrt responsiveness.
2012-04-09 22:39:47 +02:00
Fabio Erculiani e68268abe2 [RigoDaemon/Rigo] Add support for .etp and .tbz2 package files installation 2012-04-09 15:38:31 +02:00
Fabio Erculiani 415c5af799 [RigoDaemon] complete configuration file updates implementation 2012-04-08 18:13:09 +02:00
Fabio Erculiani 8a34b071b0 [Rigo/RigoDaemon] partially implement configuration file updates management 2012-04-07 19:33:28 +02:00
Fabio Erculiani d845fce5a3 [RigoDaemon] make possible to interrupt the Application Management activity 2012-04-05 17:09:41 +02:00
Fabio Erculiani 94210214ee [RigoDaemon] remove debug writes for output() and transfer_output()
They only add more confusion during debugging
2012-04-04 15:11:06 +02:00
Fabio Erculiani 3df1708e5d [RigoDaemon] implement application_enqueued() signal 2012-04-04 15:10:49 +02:00
Fabio Erculiani 210f0ceae3 [RigoDaemon] do not account unauthorized items in queue length calculation 2012-04-04 14:14:30 +02:00
Fabio Erculiani 67b899b0f7 [RigoDaemon] always release the exclusive lock at the end of queue processing 2012-04-04 01:12:28 +02:00
Fabio Erculiani 6cc6ad4c27 [RigoDaemon] pass AppTransactionOutcome enum to applications_managed() 2012-04-03 20:40:10 +02:00
Fabio Erculiani 4c20a308f4 [RigoDaemon] always spawn dbus signals from the MainThread 2012-04-03 18:04:04 +02:00
Fabio Erculiani 316893517d [RigoDaemon] add free disk space checks before starting to install 2012-04-03 14:59:01 +02:00
Fabio Erculiani 4dcafcbc1d [RigoDaemon] fix a bunch of undefined references 2012-04-03 14:58:41 +02:00
Fabio Erculiani 98742665a5 [RigoDaemon] fix undefined reference 2012-04-02 21:43:47 +02:00