aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rename pym→lib, for better distutils-r1 interoperabilityMichał Górny2018-07-181-162/+0
| | | | Closes: https://github.com/gentoo/portage/pull/343
* AsynchronousTask: add async_wait() method (bug 653856)Zac Medico2018-04-251-1/+1
| | | | | | | | | | | | Since the AsynchronousTask.wait() method is prone to event loop recursion, deprecate it, and add an async_wait() method method to replace it. Instead of using task.wait() in order to implicitly run the event loop, now loop.run_until_complete(task.async_wait()) will be used to explicitly run the event loop. This explicit approach will make it more obvious when code will trigger event loop recursion which would not be compatible with asyncio's default event loop. Bug: https://bugs.gentoo.org/653856
* EbuildBuildDir: remove synchronous lock method (bug 614112)Zac Medico2018-04-221-1/+1
| | | | | | | | | | The synchronous lock method can trigger event loop recursion if the event loop is already running, which is incompatible with asyncio's default event loop. Therefore, migrate the last consumers to use the async_lock method, and remove the synchronous lock method. Bug: https://bugs.gentoo.org/614112 Bug: https://bugs.gentoo.org/649588
* EbuildBuildDir: remove synchronous unlock method (bug 614108)Zac Medico2018-04-201-1/+1
| | | | | | | | | | The synchronous unlock method can trigger event loop recursion if the event loop is already running, which is incompatible with asyncio's default event loop. Therefore, migrate the last consumers to use the async_unlock method, and remove the synchronous unlock method. Bug: https://bugs.gentoo.org/614108 Bug: https://bugs.gentoo.org/649588
* EventLoop: implement call_later for asyncio compat (bug 591760)Zac Medico2018-02-241-6/+6
| | | | Bug: https://bugs.gentoo.org/591760
* Future: implement add_done_callback for asyncio compat (bug 591760)Zac Medico2017-03-261-2/+1
| | | | | | | | | | | | | | | | | Implement the add_done_callback and remove_done_callback methods, since they are required in order to make further progress toward asyncio compatibility. Also implement the AbstractEventLoop create_future method for the EventLoop class, so that it returns an instance of _EventLoopFuture. EventLoop currently does not implement some of the asyncio.AbstractEventLoop methods that asyncio.Future requires for its add_done_callback implementation, and the create_future method conveniently solves this problem. X-Gentoo-bug: 591760 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=591760 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* EventLoop: add run_until_complete method (bug 591760)Zac Medico2016-08-231-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | This emulates the asyncio.AbstractEventLoop.run_until_complete(future) interface, which will make it possible to reduce latency in situations where it is desirable for a loop to exit at the earliest opportunity. The most tangible benefit of this change is that it provides a migration path to asyncio, which will allow us to rely on a standard library instead of our own internal event loop implementation. In order to migrate to asyncio, more work is planned: * Migrate all internal use of the EventLoop.iteration method to the new run_until_complete(future) method, and remove the EventLoop.iteration method (or make it private as long as it's needed to implement run_until_complete for older python versions). * Implement all EventLoop methods using asyncio.AbstractEventLoop methods (but keep existing implementations for use with older python). X-Gentoo-bug: 591760 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=591760 Acked-by: Alexander Berntsen <bernalex@gentoo.org>
* Respect PYTHONDONTWRITEBYTECODE in test suite.Arfrever Frehtes Taifersar Arahesis2015-12-021-1/+2
|
* Revert "test_ipc_daemon: handle fork/finally race"Zac Medico2012-10-081-9/+0
| | | | | This reverts commit 56fbe3fe63adf4e7c5b47400182cd857d145d5b0. The race is now handled internally by spawn and ForkProcess.
* test_ipc_daemon: handle fork/finally raceZac Medico2012-10-081-0/+9
|
* PollScheduler: rename sched_iface to _sched_ifaceZac Medico2012-10-071-4/+2
| | | | | | 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: remove register/unregister methodsZac Medico2012-10-051-2/+1
| | | | | | | 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.
* TaskScheduler: inherit AsyncSchedulerZac Medico2012-10-051-22/+36
| | | | This allows the QueueScheduler class to be eliminated.
* test_ipc_daemon: implement internal SleepProcessZac Medico2012-10-041-3/+12
| | | | | Emulate the sleep command, in order to ensure a consistent return code when it is killed by SIGTERM (see bug #437180).
* test_ipc_daemon: increase sleep for bug #436334Zac Medico2012-09-261-1/+3
|
* AsynchronousTask: don't wait for exit statusZac Medico2012-02-131-4/+6
| | | | | | 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.
* IpcDaemonTestCase: init start_time earlierZac Medico2012-02-081-2/+2
| | | | | | Since commit 4620d6aba1c5c10344e311585516ee43819b703c, the SequentialTaskQueue.add() method starts the task immediately, so initialize start_time before that happens.
* locks.py: fix hardlink locks for bug #394195Zac Medico2011-12-131-0/+9
| | | | | | This updates the hardlink locking code to support the non-blocking, lockfile(wantnewlockfile=False), and lockfile(file_object) behaviors which are used by portage code.
* Use portage.shutil for safer unicode handling.Zac Medico2011-12-101-2/+2
|
* Make IpcDaemonTestCase use a finally block to unlock PORTAGE_BUILDDIR.v2.2_rc82Zac Medico2010-09-141-1/+3
|
* Make EbuildBuildDir use the PORTAGE_BUILDDIR variable instead of theZac Medico2010-09-141-1/+1
| | | | dir_path attribute.
* Make IpcDaemonTestCase use EbuildBuildDir for lock creation.Zac Medico2010-09-141-4/+14
|
* In IpcDaemonTestCase, assert that process and daemon isAlive() methodsZac Medico2010-09-051-1/+3
| | | | return False after each run.
* In the short timeout test for QueueScheduler.run(), assert that theZac Medico2010-09-031-0/+1
| | | | subprocess has stopped.
* Add a test case for intentionally short timeout with QueueScheduler.run().Zac Medico2010-09-031-1/+35
|
* Add support for a timeout argument to QueueScheduler.run() andZac Medico2010-09-031-1/+15
| | | | | use it in IpcDaemonTestCase to implement a 40 second timeout in test cases.
* Expand sys.executable earlier, so that change of sys.executable symlinkArfrever Frehtes Taifersar Arahesis2010-08-161-2/+2
| | | | | between starting main Portage process and starting ebuild.sh process doesn't affect ebuild.sh subprocesses.
* Ensure that PORTAGE_PYTHON isn't a symlink.Arfrever Frehtes Taifersar Arahesis2010-08-161-1/+1
|
* Pass along PORTAGE_USERNAME and PORTAGE_GRPNAME since theyZac Medico2010-08-151-0/+9
| | | | need to be inherited by ebuild subprocesses.
* Move PORTAGE_PYTHON setting to doebuild_environment() so that itZac Medico2010-08-141-1/+2
| | | | doesn't pollute os.environ.
* portage.os is apparently imported, so os doesn't need to be imported.Arfrever Frehtes Taifersar Arahesis2010-08-141-1/+0
|
* Ensure that all Python processes use the same version of Python.Arfrever Frehtes Taifersar Arahesis2010-08-141-0/+2
|
* Use EbuildIpcDaemon to replace the functionality ofZac Medico2010-08-131-21/+2
| | | | EBUILD_EXIT_STATUS_FILE.
* Refactor interaction between EbuildIpcDaemon and ExitCommand.Zac Medico2010-08-121-8/+6
|
* Make IpcDaemonTestCase demonstrate an EbuildIpcDaemon basedZac Medico2010-08-121-11/+42
| | | | replacement for EBUILD_EXIT_STATUS_FILE.
* Split out an EbuildIpcDaemon class from FifoIpcDaemon.Zac Medico2010-08-121-2/+2
|
* Add some pieces of an IPC framework that will eventually allow ebuildZac Medico2010-08-121-0/+40
processes can to communicate with portage's main python process. Here are a few possible uses: 1) Robust subshell/subprocess die support. This allows the ebuild environment to reliably die without having to rely on signal IPC. 2) Delegation of portageq calls to the main python process, eliminating performance and userpriv permission issues. 3) Reliable ebuild termination in cases when the ebuild has accidentally left orphan processes running in the backgraound (as in bug 278895).