| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Closes: https://github.com/gentoo/portage/pull/343
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Bug: https://bugs.gentoo.org/591760
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
This reverts commit 56fbe3fe63adf4e7c5b47400182cd857d145d5b0.
The race is now handled internally by spawn and ForkProcess.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This allows the QueueScheduler class to be eliminated.
|
|
|
|
|
| |
Emulate the sleep command, in order to ensure a consistent return code
when it is killed by SIGTERM (see bug #437180).
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Since commit 4620d6aba1c5c10344e311585516ee43819b703c, the
SequentialTaskQueue.add() method starts the task immediately, so
initialize start_time before that happens.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
dir_path attribute.
|
| |
|
|
|
|
| |
return False after each run.
|
|
|
|
| |
subprocess has stopped.
|
| |
|
|
|
|
|
| |
use it in IpcDaemonTestCase to implement a 40 second timeout
in test cases.
|
|
|
|
|
| |
between starting main Portage process and starting ebuild.sh process
doesn't affect ebuild.sh subprocesses.
|
| |
|
|
|
|
| |
need to be inherited by ebuild subprocesses.
|
|
|
|
| |
doesn't pollute os.environ.
|
| |
|
| |
|
|
|
|
| |
EBUILD_EXIT_STATUS_FILE.
|
| |
|
|
|
|
| |
replacement for EBUILD_EXIT_STATUS_FILE.
|
| |
|
|
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).
|