summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/_MergeProcess.py
Commit message (Collapse)AuthorAgeFilesLines
* Enable FD_CLOEXEC for non-blocking pipes.Zac Medico2013-01-031-1/+10
|
* _MergeProcess: tweak merge-sync library lookupZac Medico2012-12-281-2/+5
| | | | | | The library handle is no longer cached, since commit 9e37cca4f54260bd8c45a3041fcee00938c71649, so skip the LoadLibrary call and just call find_library instead.
* MergeProcess: avoid duplicate elog, bug #446136Zac Medico2012-12-101-0/+3
|
* MergeProcess: cache syncfs libc library lookupZac Medico2012-10-251-0/+6
|
* ForkProcess: set _exit finally block before forkZac Medico2012-10-081-75/+88
| | | | This is the most reliable way to handle the race condition.
* Substitute EventLoop for PollScheduler.Zac Medico2012-10-051-7/+1
| | | | | EventLoop suffices for all of these cases. EventLoop(main=False) is used for thread safety where API consumers may be using threads.
* PollScheduler: remove register/unregister methodsZac Medico2012-10-051-3/+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.
* EbuildFetcher/MergeProcess: inherit ForkProcessZac Medico2012-10-031-3/+3
| | | | | Also add missing __slots__ to ForkProcess. TODO: Share code between ForkProcess and MergeProcess.
* Close fewer file descriptors for fork / no exec.Zac Medico2012-03-271-10/+3
| | | | This will fix bug #374335.
* Remove redundant inherited __slots__ values.Zac Medico2012-02-171-1/+1
|
* Comment about _setup_pipes / PyPy GC interaction.Zac Medico2012-02-151-1/+5
|
* MergeProcess: inherit stdin for use with pdbZac Medico2012-02-151-0/+7
|
* Assert that fork returns int for bug 403697.Zac Medico2012-02-141-0/+4
| | | | | These cases should have been included with commit 6a94a074aa0475173a51f3f726377d4c407e986b.
* After python fork, don't close fds for PyPy 1.8.Zac Medico2012-02-141-1/+6
| | | | | | | | | | | | | | | | 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.
* Use IO_* constants where appropriate.Zac Medico2012-02-091-4/+3
|
* MergeProcess: handle POLLHUP from elog pipeZac Medico2012-02-081-0/+7
|
* PollScheduler: glib.io_add_watch() compatibilityZac Medico2012-02-071-0/+2
|
* MergeProcess: check if _elog_reader_fd is NoneZac Medico2011-12-011-1/+1
| | | | | It seems saner to check for None, given that _elog_reader_fd is an int, even though it will probably never be zero.
* Skip the "resume after portage update" routine.Zac Medico2011-11-171-58/+0
| | | | | | | Instead, finish the whole job using a copy of the currently running instance. This allows us to avoid the complexities of emerge --resume, such as the differences in option handling between different portage versions, as reported in bug #390819.
* Remove python-2.6 StringIO.StringIO fallback.Zac Medico2011-07-121-3/+3
| | | | | | | | Since the io module in python-2.6 was broken when threading was disabled, we needed to fall back from io.StringIO to StringIO.StringIO in this case (typically just for Gentoo's stage1 and stage2 tarballs). Now that python-2.7 is stable in stages and we rely on io.open() being available, we can also rely on io.StringIO being available.
* Uniformly check EAPI when avoiding setcpv calls.Zac Medico2011-06-041-1/+1
|
* dblink.unmerge: fix some background logic casesZac Medico2011-06-031-2/+5
|
* MergeProcess: populate vardbapi cache for new pkgZac Medico2011-05-261-0/+9
|
* PackageUninstall: make async with MergeProcessZac Medico2011-05-231-7/+23
| | | | | | | | This fixes another ebuild-locks issue like the one fixed in commit a81460175a441897282b0540cefff8060f2b92dc, but this time we use a subprocess to ensure that the ebuild-locks for pkg_prerm and pkg_postrm do not interfere with pkg_setup ebuild-locks held by the main process.
* MergeProcess: remove unnecessary dblink attributeZac Medico2011-05-231-2/+2
|
* MergeProcess: lock vdb earlier when appropriateZac Medico2011-05-101-1/+29
|
* Cache counter values, avoiding I/O when it doesn't change.David James2011-05-091-1/+2
| | | | | | | | | | This improves merge times by up to 25%, since looping over the vardb for each package install is slow. TEST=Emerge a bunch of packages, notice 25% speed improvement. BUG=chromium-os:15112 Change-Id: I51dd617219cd1820ceeb702291bd790990995be4
* vardbapi: disable subprocess vdb cache updatesZac Medico2011-05-081-0/+3
| | | | | | | | | Since commit 7535cabdf2fab76fc55df83643157613dfd66be9, vardbapi.flush_cache() is often called within subprocesses spawned from MergeProcess. The _aux_cache_threshold doesn't work as designed if the cache is flushed from a subprocess like this, can lead to the vdb cache being flushed for every single merge. This is a waste of disk IO, so disable vdb cache updates in subprocesses.
* MergeProcess: add fallback setcpv callZac Medico2011-03-261-3/+19
| | | | | | | It's important that this metadata access happens in the parent process, since closing of file descriptors in the subprocess can prevent access to open database connections such as that used by the sqlite metadata cache module.
* MergeProcess: query blockers in the main processZac Medico2011-03-261-1/+7
| | | | | Metadata cache queries may not work for some databases from within a subprocess. For example, sqlite is known to misbehave.
* MergeProcess: relocate portage reinstall codeZac Medico2011-03-261-1/+66
| | | | | This code goes inside _start since it needs to execute in the parent process.
* MergeProcess: call elog_process for replaced pkgsZac Medico2011-03-251-1/+8
|
* MergeProcess: toggle vardbapi._pkgs_changedZac Medico2011-03-251-0/+1
|
* MergeProcess: handle unicode in elog pipeZac Medico2011-03-251-2/+2
|
* MergeProcess: separate unmerge output from mergeZac Medico2011-03-251-0/+4
| | | | | | | The unmerge output has been mixed together with the merge output since commit 7535cabdf2fab76fc55df83643157613dfd66be9 because dblink._scheduler was set to None. Now it's fixed to produce separate logs like it used to.
* MergeProcess: close elog_writer_fd leakZac Medico2011-03-251-0/+1
|
* MergeProcess: Fix PORTAGE_BACKGROUND/LOG_FILE useZac Medico2011-03-241-0/+9
| | | | | | | | In this subprocess we don't want PORTAGE_BACKGROUND to suppress stdout/stderr output since they are pipes. We also don't want to open PORTAGE_LOG_FILE, since it will already be opened by the parent process, so we set the PORTAGE_BACKGROUND="subprocess" value for use in conditional logging code involving PORTAGE_LOG_FILE.
* Merge packages asynchronously in Portage.David James2011-03-241-13/+69
| | | | | | | | This allows for the scheduler to continue to run while packages are being merged and installed, allowing for additional parallelism and making better use of the CPUs. Review URL: http://codereview.chromium.org/6713043
* _MergeProcess: use default SIGINT/TERM handlersZac Medico2011-01-311-1/+7
| | | | Signal handlers inherited from the parent process are irrelevant here.
* MergeProcess: suppress finally blocks after forkZac Medico2010-11-131-4/+14
| | | | This case is like bug #345289.
* Merge package files in a subprocess.Zac Medico2010-11-111-0/+41
This allows the Scheduler to run in the main thread while files are moved or copied asynchronously.