Replies: 1 comment
-
|
It was done: https://github.com/true-async/php-async/releases/tag/v0.6.2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I'm working on a Laravel adapter for TrueAsync (similar to Laravel Octane but using native TrueAsync primitives —
Scope/Contextinstead of container cloning).During testing I found that
flock(LOCK_EX)on a contested file freezes the entire event loop, not just the waiting coroutine.Expected behavior (per docs on
proc_close()):I expected
flock()to behave the same way — suspend only the waiting coroutine while the scheduler continues running others.Reproduction
Actual output:
Ticker stops completely. Holder's
delay(500)never fires. All three scopes are frozen.How this manifests in Laravel
Laravel's
FileSessionHandler::write()callsfile_put_contents($path, $data, LOCK_EX).With concurrent requests and
delay()in a route handler, multiple coroutines hit session write simultaneously — lock contention freezes the entire server.file_put_contentsitself is in the async function list, but theLOCK_EXflag internally callsflock()which is not async-wrapped.Question
Is
flock()planned to be covered with async support (similar to howproc_close()blocks only the current coroutine)?This is critical for framework adapters since file-based sessions, cache drivers, and file locks are common in Laravel/Symfony.
Beta Was this translation helpful? Give feedback.
All reactions