Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plug daemon memory leak #77

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion yaqd-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

## [Unreleased]

## [2023.11.0]

### Fixed
- Fixed memory leak in daemon server that scaled with number of connections

## [2023.6.0]

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

[Unreleased]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.6.0...main
[Unreleased]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.11.0...main
[2023.11.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.6.0..2023.11.0
[2023.6.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2023.2.0...2023.6.0
[2023.2.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2022.8.0...2023.2.0
[2022.8.0]: https://github.com/yaq-project/yaq-python/compare/yaqd-core-2022.7.0...2022.8.0
Expand Down
2 changes: 1 addition & 1 deletion yaqd-core/yaqd_core/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

__avro_version__ = "1.9.2"

__version__ = "2023.6.0"
__version__ = "2023.11.0"

try:
__branch__ = (
Expand Down
4 changes: 2 additions & 2 deletions yaqd-core/yaqd_core/_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self, daemon, *args, **kwargs):
def connection_lost(self, exc):
peername = self.transport.get_extra_info("peername")
self.logger.info(f"Connection lost from {peername} to {self._daemon.name}")
self.task.cancel()
self._daemon._connection_lost(peername)

def connection_made(self, transport):
Expand All @@ -27,8 +28,7 @@ def connection_made(self, transport):
self.transport = transport
self.unpacker = avrorpc.Unpacker(self._avro_protocol)
self._daemon._connection_made(peername)
task = asyncio.get_event_loop().create_task(self.process_requests())
self._daemon._tasks.append(task)
self.task = asyncio.get_event_loop().create_task(self.process_requests())

def data_received(self, data):
"""Process an incomming request."""
Expand Down