Skip to content

Commit 6bbe5dd

Browse files
authored
Ignore Event Loop is closed error on close (#289)
1 parent 836e636 commit 6bbe5dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/viam/rpc/dial.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def close(self):
160160
if not self._closed:
161161
try:
162162
self.channel.close()
163+
except RuntimeError as e:
164+
# ignore event loop is closed errors - robot is getting shutdown
165+
if len(e.args) > 0 and e.args[0] == "Event loop is closed":
166+
LOGGER.debug("ViamChannel might not have shut down cleanly - Event loop was closed")
167+
return
168+
raise
163169
finally:
164170
self.release()
165171
self._closed = True

0 commit comments

Comments
 (0)