Don't log aboout unknown status msg if no oid
parent
5861839783
commit
973bf87e67
|
@ -728,7 +728,6 @@ async def translate_and_relay_brokerd_events(
|
||||||
# msg-chain/dialog.
|
# msg-chain/dialog.
|
||||||
ems_client_order_stream = router.dialogues[oid]
|
ems_client_order_stream = router.dialogues[oid]
|
||||||
status_msg = book._active[oid]
|
status_msg = book._active[oid]
|
||||||
old_resp = status_msg.resp
|
|
||||||
status_msg.resp = status
|
status_msg.resp = status
|
||||||
|
|
||||||
# retrieve existing live flow
|
# retrieve existing live flow
|
||||||
|
@ -736,7 +735,8 @@ async def translate_and_relay_brokerd_events(
|
||||||
if old_reqid and old_reqid != reqid:
|
if old_reqid and old_reqid != reqid:
|
||||||
log.warning(
|
log.warning(
|
||||||
f'Brokerd order id change for {oid}:\n'
|
f'Brokerd order id change for {oid}:\n'
|
||||||
f'{old_reqid} -> {reqid}'
|
f'{old_reqid}:{type(old_reqid)} ->'
|
||||||
|
f' {reqid}{type(reqid)}'
|
||||||
)
|
)
|
||||||
|
|
||||||
status_msg.reqid = reqid # THIS LINE IS CRITICAL!
|
status_msg.reqid = reqid # THIS LINE IS CRITICAL!
|
||||||
|
@ -856,12 +856,16 @@ async def translate_and_relay_brokerd_events(
|
||||||
'status': status,
|
'status': status,
|
||||||
'reqid': reqid,
|
'reqid': reqid,
|
||||||
}:
|
}:
|
||||||
status_msg = book._active[oid]
|
oid = book._ems2brokerd_ids.inverse.get(reqid)
|
||||||
log.warning(
|
msg = f'Unhandled broker status for dialog {reqid}:\n'
|
||||||
'Unhandled broker status for dialog:\n'
|
if oid:
|
||||||
f'{pformat(status_msg)}\n'
|
status_msg = book._active[oid]
|
||||||
f'{pformat(brokerd_msg)}\n'
|
msg += (
|
||||||
)
|
f'last status msg: {pformat(status_msg)}\n\n'
|
||||||
|
f'this msg:{pformat(brokerd_msg)}\n'
|
||||||
|
)
|
||||||
|
|
||||||
|
log.warning(msg)
|
||||||
|
|
||||||
case _:
|
case _:
|
||||||
raise ValueError(f'Brokerd message {brokerd_msg} is invalid')
|
raise ValueError(f'Brokerd message {brokerd_msg} is invalid')
|
||||||
|
|
Loading…
Reference in New Issue