summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/PollScheduler.py
Commit message (Collapse)AuthorAgeFilesLines
* portage._internal_caller: use global_event_loopZac Medico2013-01-031-2/+4
| | | | | It's more efficient to use global_event_loop than a local EventLoop instance, so do that when we know it's safe.
* PollScheduler: fix _schedule() to return Truev2.2.0_alpha137Zac Medico2012-10-101-2/+4
| | | | | | This fixes a regression like bug #403895, introduced in commit b696337bf20fdc539ce7721df7a4b42b35999705, since functions have to return True in order to be continuously scheduled.
* PollScheduler: disable default _loadavg_latencyZac Medico2012-10-081-1/+1
| | | | | | Move the 30 second default to the Scheduler class, since that's the only place that it's currently needed (all other schedulers have relatively short-running jobs).
* PollScheduler: rename sched_iface to _sched_ifaceZac Medico2012-10-071-1/+1
| | | | | | It isn't used externally anymore, since SchedulerInterface is used directly in those places now. Many of the self.sched_iface references updated here, it's more appropriate to use self._event_loop.
* PollScheduler: split out SchedulerInterfaceZac Medico2012-10-071-72/+6
|
* PollScheduler: move _main_loop to SchedulerZac Medico2012-10-061-30/+0
|
* PollScheduler: remove register/unregister methodsZac Medico2012-10-051-5/+3
| | | | | | | These methods were aliases for the EventLoop io_add_watch and source_remove methods. Migrating to the EventLoop method names allows an EventLoop instance to substitute for a PollScheduler inside subclasses of AbstractPollTask.
* PollScheduler: remove self._jobsZac Medico2012-10-051-2/+1
| | | | This is variable is only needed by the Scheduler class.
* egencache: add --update-manifests, bug #436918Zac Medico2012-10-031-2/+4
| | | | | | | | | | Update manifest files, and sign them if signing is enabled. This supports parallelization if enabled via the --jobs option. The --thin-manifests and --sign-manifests options may be used to manually override layout.conf settings. There's also a new --strict-manifests option that may be used to manually override the "strict" FEATURES setting, a --gpg-key option to override PORTAGE_GPG_KEY, and a --gpg-dir option to override PORTAGE_GPG_DIR.
* PollScheduler: use timeout for loadavg checksZac Medico2012-08-201-6/+12
| | | | | | | This ensures that the code from commit fe03b5fd790fc09bd6594c55bb174e80aaac1e5a behaves correctly even when there are no poll events arriving for a long time (which might happen if the running builds don't produce output for a long time).
* PollScheduler: schedule inside loop if max_loadZac Medico2012-06-241-3/+10
| | | | | This will fix a case like that reported in bug #403895, triggered when the --load-average option is used.
* PollScheduler: use local EventLoop (thread safe)Zac Medico2012-05-101-2/+12
| | | | | | | For API consumers, this makes the doebuild() function compatible with threads, avoiding a ValueError raised by the signal module, as reported at http://bugs.sabayon.org/show_bug.cgi?id=3305. Classes derived from PollScheduler still use the signal module when possible.
* Replace @returns with @return.Zac Medico2012-03-271-1/+1
|
* Move _emerge.SlotObject to portage.util.Zac Medico2012-02-171-1/+1
|
* EventLoop: implement child_watch_addZac Medico2012-02-161-1/+3
|
* AsynchronousTask: don't wait for exit statusZac Medico2012-02-131-0/+3
| | | | | | Synchronous waiting for status is not supported, since it would be vulnerable to hitting the recursion limit when a large number of tasks need to be terminated simultaneously, like in bug #402335.
* PollScheduler: use idle_add to check terminationZac Medico2012-02-121-22/+39
| | | | | | | | | This fixes a regression in termination signal handling since commit 8c1fcf5a9ba9fa4d406a4d0cc284fe73a84f5a63, which cause termination signals to be ignored until a running job had exited. This regression is not really noticeable for Ctrl-C handling, since in that case the SIGINT propagets to subprocesses, causing them to exit and trigger a _schedule() call whichtriggers a termination check.
* PollScheduler: return None from _schedule_tasksZac Medico2012-02-111-5/+10
| | | | The _keep_scheduling() template method is used instead.
* PollScheduler: add generic _main_loop()Zac Medico2012-02-101-0/+22
|
* Use IO_* constants where appropriate.Zac Medico2012-02-091-1/+8
|
* Add global_event_loop() and GlibEventLoop.Zac Medico2012-02-091-2/+2
| | | | | | This causes all PollScheduler instances within a given process to share a singleton EventLoop instance, and also makes it possible to swap in glib's main loop for all portage event loops in the main process.
* Move EventLoop to a separate file.Zac Medico2012-02-081-366/+1
|
* PollScheduler: remove _poll_loopZac Medico2012-02-081-22/+2
| | | | | We can use iteration() instead, and _poll_loop's exit behavior doesn't seem practical to emulate with glib.MainLoop.
* PollScheduler: remove EventLoop._schedule hookZac Medico2012-02-081-12/+5
| | | | | PollScheduler and subclasses be should already be calling self._schedule() when necessary.
* EventLoop: use same method names as glibZac Medico2012-02-081-16/+16
|
* PollScheduler: don't inherit EventLoopZac Medico2012-02-081-10/+12
|
* PollScheduler: split out EventLoop base classZac Medico2012-02-081-106/+116
|
* PollScheduler: remove _schedule_waitZac Medico2012-02-071-47/+1
|
* PollScheduler: add iteration methodZac Medico2012-02-071-9/+24
|
* PollScheduler: implement idle_addZac Medico2012-02-071-1/+45
|
* PollScheduler: glib.io_add_watch() compatibilityZac Medico2012-02-071-16/+34
|
* PollScheduler: timeouts regardless of IO eventsZac Medico2012-02-071-9/+50
| | | | | | Now PollScheduler will execute timeouts predictably, even when there no IO events being generated. This allows the Scheduler's display updates to be handled via timeout_add.
* PollScheduler: add timeout_add like glib'sZac Medico2012-02-071-4/+85
| | | | | This will be useful as a substitute for recursion, in order to avoid hitting the recursion limit for bug #402335.
* python3.2 fixes: ResourceWarning: unclosed fileZac Medico2011-08-251-0/+3
|
* PollScheduler: tweak _unregister event cleanupZac Medico2011-03-251-5/+9
|
* PollScheduler: handle missing log directoryZac Medico2011-03-251-12/+23
| | | | | This can be triggered by AbstractPollTask._log_poll_exception(), as reported by Michael Haubenwallner <haubi@gentoo.org> for AIX.
* PollScheduler: tweek termination logicZac Medico2011-03-101-0/+21
| | | | | | | | | * PollScheduler and all subclasses now use the _terminated_tasks variable to check whether or not _terminate_tasks() has been called, and behave appropriately in that case. * The _schedule_tasks() method now has documentation about the relationship with _terminate_tasks() and _terminated_tasks.
* PollScheduler: call _terminate_tasks in _scheduleZac Medico2011-03-101-7/+11
| | | | | This prevents it from being called while the _schedule_tasks() implementation is running, in order to avoid potential interference.
* Add PollScheduler.terminate() for interruption.Zac Medico2011-01-151-1/+30
| | | | | This allows PollScheduler instances to do basic cleanup and terminate gracefully when SIGINT or SIGTERM signals are received.
* Add sanity checks for system clock changes.Zac Medico2010-10-231-1/+7
|
* Fix parallel-fetch output by BinpkgVerifier.Zac Medico2010-10-141-2/+8
| | | | | BinpkgVerifier was erroneusly sending parallel-fetch output to stdout. Thanks to Jeremy Olexa <darkside@g.o> for reporting.
* Add a 'condition' keyword argument to PollScheduler._schedule_wait()Zac Medico2010-09-131-1/+3
| | | | | which is a callable that should return True when it is desirable for the _schedule_wait() method to return.
* Add support for a timeout argument to QueueScheduler.run() andZac Medico2010-09-031-5/+11
| | | | | use it in IpcDaemonTestCase to implement a 40 second timeout in test cases.
* Remove unused imports found by pylint.Arfrever Frehtes Taifersar Arahesis2010-08-291-1/+0
|
* Bug #324191 - Add support for FEATURES=compress-build-logs. The causesZac Medico2010-08-211-2/+36
| | | | | | | all build logs to be compressed while they are being written. Log file names have an extension that is appropriate for the compression type. Currently, only gzip(1) compression is supported, so build logs will have a '.gz' extension when this feature is enabled.
* Remove PollScheduler._schedule_waitpid() since this case isn't triggeredZac Medico2010-08-151-28/+1
| | | | | | anymore, now that PollScheduler._unregister() has be fixed to discard unhandled events (so that reallocation of file descriptors no longer triggers erroneous delivery of stale events).
* Don't handle KeyError when looking up event handlers, sinceZac Medico2010-08-151-31/+12
| | | | _unregister() automatically discards stale events now.
* Fix PollScheduler._unregister() to discard any unhandled eventsZac Medico2010-08-151-0/+13
| | | | | | | | | that belong to the unregistered file, in order to prevent these events from being erroneously delivered to a future handler that is using a reallocated file descriptor of the same numeric value (causing extremely confusing bugs). Note that this is was the cause of the intermittent bug that forced me to disable EbuildIpcDaemon by default.
* Fix _schedule spelling in _schedule_waitpid().Zac Medico2010-08-141-1/+1
|
* Add a PollScheduler._schedule_waitpid() method for SubProcess._wait()Zac Medico2010-08-141-1/+32
| | | | | to use as an alternative to hanging up the scheduler in a blocking waitpid call.