Describe the bug
Calling cancel() on an AwsQuantumTask in the "QUEUED" state raises a RuntimeError.
To reproduce
from braket.aws import AwsDevice
from braket.circuits import Circuit
from braket.devices import Devices
device = AwsDevice(Devices.IonQ.Forte1)
bell = Circuit().h(0).cnot(0, 1)
task = device.run(bell)
task.cancel()
This raises:
RuntimeError: There is no current event loop in thread 'MainThread'.
The job is not cancelled.
Expected behavior
The task should be cancelled, with no error.
Describe the bug
Calling
cancel()on anAwsQuantumTaskin the "QUEUED" state raises aRuntimeError.To reproduce
This raises:
The job is not cancelled.
Expected behavior
The task should be cancelled, with no error.