athenad: explicitly delete socket in getMessage (#34098)

explicitly delete socket in getMessage
pull/34118/head
Dean Lee 5 months ago committed by GitHub
parent 8f71d53eb0
commit b737e8472f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      system/athena/athenad.py

@ -309,6 +309,7 @@ def getMessage(service: str, timeout: int = 1000) -> dict:
raise Exception("invalid service")
socket = messaging.sub_sock(service, timeout=timeout)
try:
ret = messaging.recv_one(socket)
if ret is None:
@ -316,6 +317,8 @@ def getMessage(service: str, timeout: int = 1000) -> dict:
# this is because capnp._DynamicStructReader doesn't have typing information
return cast(dict, ret.to_dict())
finally:
del socket
@dispatcher.add_method

Loading…
Cancel
Save