Skip to content

Attempt to cancel a job raises error #1305

Description

@cqc-alec

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions