-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception on closing context #96
Comments
What python version is involved? Which concurrency method? (thread, cothread, asyncio, Qt?) This is probably another instance of GC loop breaking Having partially disassembled the object. The I'm tempted to decorate all of my Cython extension types with |
Sorry I should have added the python version to the report. |
I've just stumbled upon this while reporting #115. Running a p4p server then a p4p asyncio client that raises a remote exception seems to trigger it. Run the server: # p4p_server.py
from p4p.nt import NTScalar
from p4p.server import Server
from p4p.server.thread import SharedPV
pv = SharedPV(nt=NTScalar('ai'), initial=[1,2,3]) # int32 array
@pv.put
def handle(pv, op):
v = op.value()
print(f"Updating to {v}")
pv.post(v) # just store and update subscribers
op.done()
Server.forever(providers=[{
'demo:pv:name':pv,
}]) Then run the client: # p4p_client.py
from p4p.client.asyncio import Context
import numpy as np
import asyncio
pv = 'demo:pv:name'
async def f():
with Context("pva", nt=False) as c:
print(f"Initial: {(await c.get(pv)).value}")
await c.put(pv, [4, 5, 6])
print(f"List works: {(await c.get(pv)).value}")
await c.put(pv, np.array([7, 8, 9]))
print(f"Np.int64 array doesn't: {(await c.get(pv)).value}")
asyncio.run(f()) Server gives a remote exception, then client gives output:
Running on Linux with python 3.10.6, p4p 4.1.9, pvxslibs 1.2.2, epicscorelibs 7.0.7.99.0.2 |
As it happens, I managed to trigger this issue today and have made another attempt at fixing with 546b919 |
On version 4.1.5 when closing the context or stopping the script I get the following:
This is on a Mac.
I don't see this on 4.1.2, but see it on all later versions.
The text was updated successfully, but these errors were encountered: