rigetti / rpcq

The RPC framework and message specification for @rigetti Quantum Cloud Services.
Apache License 2.0
76 stars 29 forks source link

KILL-THREAD-SLOWLY #113

Closed appleby closed 4 years ago

appleby commented 4 years ago

Add a (SLEEP 1) after every BT:DESTROY-THREAD call.

This is a work-around that enables switching over to EC2 runners for the gitlab CI. Something about the EC2 environment was tickling a race in our combination of using BT:DESTROY-THREAD + our reliance on PZMQ's implicit global *DEFAULT-CONTEXT*.

A proper fix for this likely entails some combination of

1) Explicitly creating our own PZMQ:CONTEXT in RPCQ:START-SERVER and passing that down to worker threads.

2) Adding a graceful shutdown option to the RPCQ server to avoid the need to BT:DESTROY-THREAD (see #75).

appleby commented 4 years ago

I'm planning to follow this up "real soon" with a "real fix", but wanted to unblock the wheels of progress on ec2 enabling.

Of course, by the law of Quick-and-Dirty Temporary Fixes, this hack will probably outlive us all.