mirror of
https://opendev.org/x/pyghmi
synced 2026-08-28 17:46:44 +00:00
Remove event related memory leak
It was possible for a session to accumulate a plurality of events per raw_command issued. Alter the behavior of session to set and discard *all* pending events on exit. This means that if there are multiple commands waiting, then things will be a tad more work than is strictly necessary, but it's the simplest way to eliminate the leak, the amount of senseless work is pretty small even in some pretty tortuous cases, and it only has any impact when many commands are being hit against same target concurrently without coordination, which is rare. Change-Id: I3f023cee6fc7bb537c1a508d3113f2ff238828de
This commit is contained in:
@@ -680,7 +680,7 @@ class Session(object):
|
||||
self.incommand = False
|
||||
if retry and lastresponse is None:
|
||||
raise exc.IpmiException('Session no longer connected')
|
||||
if self.evq:
|
||||
while self.evq:
|
||||
self.evq.popleft().set()
|
||||
return lastresponse
|
||||
|
||||
|
||||
Reference in New Issue
Block a user