-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
I've seen frequent cases where the code seems to deadlock in the req_id = self._client.next_order_id() line below. Deadlock monitoring has been added to try to find the problem.
def order_place(self, contract: RegisteredContract, order: Order) -> Request:
"""Places an order.
Args:
contract (RegisteredContract): contract to place an order on
order (Order): order to place
"""
self._assert_connected()
if contract.is_multi():
raise Exception(
f"RegisteredContracts with multiple contract details are not supported for orders: {contract}")
req_id = self._client.next_order_id()
cd = contract.contract_details[0]
self._client.log_request(req_id, "PlaceOrder", cd.contract, {"order": f"Order({order})"})
self._client.placeOrder(req_id, cd.contract, order)
return Request(request_id=req_id, cancel_func=self.order_cancel)
Metadata
Metadata
Assignees
Labels
No labels