summaryrefslogtreecommitdiffstats
path: root/pym
Commit message (Collapse)AuthorAgeFilesLines
* EventLoop: wakeup poll loop to receive sigchildZac Medico2012-02-161-1/+12
| | | | | | TODO: Find out why SIGCHLD signals aren't delivered during poll calls, forcing us to wakeup in order to receive them. This fixes random hangs in poll calls since commit 1979a6cdfcd8c6bae4565982d82d862be07ba5be.
* EventLoop: fix signal race in _sigchld_initZac Medico2012-02-161-1/+1
|
* EventLoop: fix _sigchld_io_cb to return TrueZac Medico2012-02-161-0/+1
| | | | | This fixes an infinite loop since commit 1979a6cdfcd8c6bae4565982d82d862be07ba5be.
* SubProcess: use child_watch_addZac Medico2012-02-161-29/+7
| | | | | This fixes performance issues introduced by commit 9c664779a16f6cbca8a5ffe7f6b0c68572819723.
* EventLoop: implement child_watch_addZac Medico2012-02-163-1/+99
|
* portage.update.fixdbentries(): Fix ResourceWarnings with Python 3.2.Arfrever Frehtes Taifersar Arahesis2012-02-161-2/+3
|
* SubProcess: use non-blocking waitpidZac Medico2012-02-151-12/+27
| | | | | This ensures that the EventLoop will not stop due to a waitpid call blocking forever.
* EventLoop.iteration: sleep if no IO handlersZac Medico2012-02-151-1/+13
| | | | | | | Sleep so that we don't waste cpu time by looping too quickly. This makes EventLoop useful for code that needs to wait for timeout callbacks regardless of whether or not any IO handlers are currently registered.
* EventLoop.timeout_add: fix inverted min intervalZac Medico2012-02-151-1/+1
|
* Comment about _setup_pipes / PyPy GC interaction.Zac Medico2012-02-152-2/+10
|
* SpawnProcess: use os.open for /dev/null inputZac Medico2012-02-151-3/+3
|
* MergeProcess: inherit stdin for use with pdbZac Medico2012-02-151-0/+7
|
* treewalk: handle EAGAIN from listdir for PyPy 1.8Zac Medico2012-02-151-2/+15
|
* get_open_fds: handle EAGAIN for PyPy 1.8Zac Medico2012-02-151-1/+15
|
* Scheduler: PyPy WeakValueDictionary.pop KeyErrorZac Medico2012-02-141-1/+8
| | | | | | | KeyError observed from WeakValueDictionary.pop() with PyPy 1.8, despite None given as default. Note that PyPy 1.8 has the same WeakValueDictionary code as CPython 2.7, so it may be possible for CPython to raise KeyError here as well.
* SpawnProcess: for stdout use os.write, not fdopenZac Medico2012-02-141-6/+5
|
* repoman: fix ebuild.badheader for bug #403705Zac Medico2012-02-141-0/+1
|
* SubProcess._wait: add debug code for bug #403697Zac Medico2012-02-141-0/+6
|
* Assert that fork returns int for bug 403697.Zac Medico2012-02-142-0/+7
| | | | | These cases should have been included with commit 6a94a074aa0475173a51f3f726377d4c407e986b.
* AsynchronousTask: skip cancelled check in _startZac Medico2012-02-142-6/+0
| | | | | These checks should be irrelevant, since the cancel() method is never called on anything that hasn't been started already.
* EventLoop: allow IO event handler re-entranceZac Medico2012-02-141-11/+6
| | | | | | IO event handlers may be re-entrant, in case something like AbstractPollTask._wait_loop(), needs to be called inside a handler for some reason.
* After python fork, don't close fds for PyPy 1.8.Zac Medico2012-02-143-11/+22
| | | | | | | | | | | | | | | | If we close all open file descriptors after a fork, with PyPy 1.8 it triggers "[Errno 9] Bad file descriptor" later in the subprocess. Apparently it is holding references to file descriptors and closing them after they've already been closed and re-opened for other purposes. As a workaround, we don't close the file descriptors, so that they won't be re-used and therefore we won't be vulnerable to this kind of interference. The obvious caveat of not closing the fds is that the subprocess can hold locks that belonged to the parent process, even after the parent process has released the locks. Hopefully this won't be a major problem though, since the subprocess has to exit at release the lock eventually, when the EbuildFetcher or _MergeProcess task is complete.
* EventLoop._do_poll: tweak EINTR handlingZac Medico2012-02-131-13/+14
| | | | | | | Silently handle EINTR, which is normal when we have received a signal such as SIGINT. Also, raise StopIteration in order to break out of our current iteration and respond appropriately to the signal as soon as possible.
* AsynchronousTask: don't wait for exit statusZac Medico2012-02-139-15/+35
| | | | | | 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.
* EventLoop: make _poll/_run_timeouts re-entrantZac Medico2012-02-131-62/+73
| | | | | | | This fixes infinite loops triggered by Ctrl-C, where timeout calls would exhaust the poll event queue because _poll was not re-entrant. Now, re-entrance is only prohibited for individual callback functions, in order to protect against infinite recursion.
* Handle missing os.setgroups for PyPy.Zac Medico2012-02-133-2/+21
| | | | See https://bugs.pypy.org/issue833 for details.
* checksum.py: remove PyPy 1.7 workaroundsZac Medico2012-02-131-30/+1
| | | | | | The corresponding hashlib issues are fixed in PyPy 1.8: https://bugs.pypy.org/issue957
* PollScheduler: use idle_add to check terminationZac Medico2012-02-122-22/+41
| | | | | | | | | 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.
* repoman: check for env-update, bug #402339Zac Medico2012-02-121-1/+1
|
* Scheduler: simplify _sched_iface constructionv2.2.0_alpha86Zac Medico2012-02-111-14/+3
|
* EbuildIpcDaemon: handle POLLHUP, bug #401919Zac Medico2012-02-111-0/+24
|
* AbstractPollTask: merge _wait from subclassZac Medico2012-02-112-12/+6
|
* xpak.unpackinfo: validate paths, bug #403149Zac Medico2012-02-111-24/+20
|
* QueueScheduler: tweak run loop logicZac Medico2012-02-111-5/+5
|
* EventLoop.iteration: handle _poll StopIterationZac Medico2012-02-111-1/+7
|
* MetadataRegen: use porttreesZac Medico2012-02-111-1/+4
|
* _emerge.MetadataRegen.MetadataRegen._iter_metadata_processes():Arfrever Frehtes Taifersar Arahesis2012-02-111-21/+23
| | | | Regenerate metadata for given cpv in each repository.
* EventLoop: remove obsolete timeout_add commentZac Medico2012-02-111-7/+0
|
* EventLoop.iteration: run timeouts if no fdsZac Medico2012-02-111-1/+9
|
* PollScheduler: return None from _schedule_tasksZac Medico2012-02-113-15/+12
| | | | The _keep_scheduling() template method is used instead.
* QueueScheduler: timeout compat for GlibEventLoopZac Medico2012-02-111-10/+19
| | | | | | | | Raising StopIteration doesn't work with GlibEventLoop, since it catches all exceptions and logs them. So, just use a boolean expression to terminate the while loop. This depends on commit dcb9fab8463996542d06d29bc383f5933bf0d677 so that IpcDaemonTestCase timeouts work correctly with both EventLoop and GlibEventLoop.
* EventLoop: shorten iteration poll if timeoutsZac Medico2012-02-111-1/+1
| | | | | | | | | This fixes EventLoop.iteration() so that it doesn't poll too long when there are timeouts registered, since it's not nice to spend a long time polling for an IO event that might never arrive even though a timeout may have changed some state that would terminate a timeout loop like in QueueScheduler.run() or AbstractPollTask._wait_loop(). This makes EventLoop.iteration() behave more like GlibEventLoop.iteration().
* Fix FEATURES=no{doc,info,man} for bug #403181Zac Medico2012-02-111-1/+4
| | | | | This has been broken since commit 93b654199a32fc3df1299b030317720b9294b0c3.
* display_autounmask: highlight config changesZac Medico2012-02-101-4/+12
| | | | | | As suggested here: http://archives.gentoo.org/gentoo-dev/msg_06a47ad55977f4d16bfe18769c6c38b8.xml
* GlibEventLoop: use gi.repository.GLibZac Medico2012-02-101-5/+1
|
* PollScheduler: add generic _main_loop()Zac Medico2012-02-104-27/+30
|
* Scheduler: cleanup timeout after _main_loopZac Medico2012-02-101-2/+3
| | | | | The way we don't leave an leak a reference to the Scheduler instance in the global EventLoop instance.
* EbuildMerge: add exit_hook to unlock build dirZac Medico2012-02-103-5/+7
| | | | | | | | This is needed since commit 7a6c34cc6bd6eb20a97e05347f87a0157f4ae58a in order to ensure that the build dir is unlocked before exit listeners are called. It fixes failures in catalyst stage 1 builds where two instances of the same package, built sequentially for separate roots, interfere with eachother's build dir lock.
* Use IO_* constants where appropriate.Zac Medico2012-02-097-23/+38
|
* EventLoop: name poll constants like glib'sZac Medico2012-02-092-1/+14
| | | | | | It's conceivable the constants could be implementation dependent, so use glib's generic IO_* names rather than the POLL* names which are associated specifically with python's select.poll object.