Skip to content

Commit 014eb7d

Browse files
committed
WIP elasticapm: properly cleanup buffer and data views
1 parent 70d152b commit 014eb7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

elasticapm/transport/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def _flush(self, buffer, forced_flush=False) -> None:
250250
"""
251251
if not self.state.should_try():
252252
logger.error("dropping flushed data due to transport failure back-off")
253+
buffer.close()
253254
else:
254255
fileobj = buffer.fileobj # get a reference to the fileobj before closing the gzip file
255256
buffer.close()
@@ -261,6 +262,8 @@ def _flush(self, buffer, forced_flush=False) -> None:
261262
except Exception as e:
262263
self.handle_transport_fail(e)
263264

265+
data.release()
266+
264267
def start_thread(self, pid=None) -> None:
265268
super(Transport, self).start_thread(pid=pid)
266269
if (not self._thread or self.pid != self._thread.pid) and not self._closed:

0 commit comments

Comments
 (0)