If I try to use multiprocessing.Value for synchronization with aiomultiprocess.Process and uvloop even loop, the process gets silently terminated with no error messages.
Example
from aiomultiprocess import Process
import uvloop
from time import sleep
from multiprocessing import Value
async def func(signal):
signal.value
raise ValueError
if __name__ == '__main__':
signal = Value('i', 0)
proc = Process(
target=func,
loop_initializer=uvloop.new_event_loop,
args=(signal,),
)
proc.start()
sleep(1)
assert proc.is_alive()
Expected behavior
In this example, I would expect the ValueError to be raised and displayed. This is indeed what happens if the signal.value line is removed.
Current behavior
Currently an assertion error is raised,
assert proc.is_alive()
AssertionError
which means that the process is either never started or is terminated before reaching the line that raises the ValueError.
Am I doing something wrong?
Versions
Python 3.10.8 on Ubuntu Linux
aiomultiprocess 0.9.0
uvloop 0.17.0
If I try to use
multiprocessing.Valuefor synchronization withaiomultiprocess.Processand uvloop even loop, the process gets silently terminated with no error messages.Example
Expected behavior
In this example, I would expect the
ValueErrorto be raised and displayed. This is indeed what happens if thesignal.valueline is removed.Current behavior
Currently an assertion error is raised,
which means that the process is either never started or is terminated before reaching the line that raises the
ValueError.Am I doing something wrong?
Versions