Skip to content

Commit 39733a9

Browse files
authored
plug daemon memory leak (#77)
* Update _protocol.py * Update CHANGELOG.md * bump version
1 parent 2735e4e commit 39733a9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

yaqd-core/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
55

66
## [Unreleased]
77

8+
## [2023.11.0]
9+
10+
### Fixed
11+
- Fixed memory leak in daemon server that scaled with number of connections
12+
813
## [2023.6.0]
914

1015
### Added
@@ -337,7 +342,8 @@ There are no actual code changes, this release is to update the release pipeline
337342
- Generic Client
338343
- Continuous hardware base daemon
339344

340-
[Unreleased]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.6.0...main
345+
[Unreleased]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.11.0...main
346+
[2023.11.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.6.0..2023.11.0
341347
[2023.6.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.2.0...2023.6.0
342348
[2023.2.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2022.8.0...2023.2.0
343349
[2022.8.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2022.7.0...2022.8.0

yaqd-core/yaqd_core/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
__avro_version__ = "1.9.2"
1313

14-
__version__ = "2023.6.0"
14+
__version__ = "2023.11.0"
1515

1616
try:
1717
__branch__ = (

yaqd-core/yaqd_core/_protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(self, daemon, *args, **kwargs):
1818
def connection_lost(self, exc):
1919
peername = self.transport.get_extra_info("peername")
2020
self.logger.info(f"Connection lost from {peername} to {self._daemon.name}")
21+
self.task.cancel()
2122
self._daemon._connection_lost(peername)
2223

2324
def connection_made(self, transport):
@@ -27,8 +28,7 @@ def connection_made(self, transport):
2728
self.transport = transport
2829
self.unpacker = avrorpc.Unpacker(self._avro_protocol)
2930
self._daemon._connection_made(peername)
30-
task = asyncio.get_event_loop().create_task(self.process_requests())
31-
self._daemon._tasks.append(task)
31+
self.task = asyncio.get_event_loop().create_task(self.process_requests())
3232

3333
def data_received(self, data):
3434
"""Process an incomming request."""

0 commit comments

Comments
 (0)