Using zend.exception_ignore_args=0 (default)
|
try { |
|
$channel->send($result); |
|
} catch (SerializationException $exception) { |
|
// Could not serialize task result. |
|
$channel->send(new Internal\TaskFailure($id, $exception)); |
|
} |
Whenever a $result fails to be serialized, an exception is thrown, which will include the arguments including $result in the serialization. Which then again fails to serialize, leading to the whole runner process blowing up.
There's a couple possibilities I see to solve this:
a) Force zend.exception_ignore_args=1 in the worker process.
b) Sanitize any sent Throwable's collected arguments from non-serializables.
c) Send exceptions as strings instead of serialized objects.
In my concrete use case it was caused by an exception thrown by the parallel mode of amphp/file - which was attempted to be serialized and contained some DeferredCancellation in the stacktrace.
Using
zend.exception_ignore_args=0(default)parallel/src/Worker/Internal/task-runner.php
Lines 76 to 81 in 6bcfa22
Whenever a $result fails to be serialized, an exception is thrown, which will include the arguments including $result in the serialization. Which then again fails to serialize, leading to the whole runner process blowing up.
There's a couple possibilities I see to solve this:
a) Force
zend.exception_ignore_args=1in the worker process.b) Sanitize any sent Throwable's collected arguments from non-serializables.
c) Send exceptions as strings instead of serialized objects.
In my concrete use case it was caused by an exception thrown by the parallel mode of amphp/file - which was attempted to be serialized and contained some DeferredCancellation in the stacktrace.