Refactor to fix memory leaks
Memory Leak Fixes & Refactoring
EGPProtocol
- Fixed incorrect condition in
_create_id_to_request
pop operation
MagicLinkLayerProtocol
- Replaced dynamic
namedtuple
with explicitQueueItem
class for better type annotations - Introduced
Delivery
object to track deliveries in MagicDistributor - Removed redundant self-calling
self._defer_handle_next()
when capacity is zero
MagicDistributor
- Replaced event-based bookkeeping with dedicated
Delivery
andNodeDelivery
objects - Added properties:
-
node_deliveries
list toDelivery
-
in_process
flag to bothDelivery
andNodeDelivery
-
state_delivery_evt
andlabel_delivery_evt
toNodeDelivery
-
- Consolidated multiple event tracking properties into
_deliveries
and_archived_deliveries
- Modified signatures:
-
add_delivery()
: now returnsDelivery
object instead of event -
abort_delivery()
: now acceptsDelivery
object instead of event -
abort_all_delivery()
: now returnsDelivery
objects instead ofNodeDelivery
objects
-
MagicQLink
- Updated to accommodate signature changes in
MagicDistributor.abort_all_delivery()
Edited by Michał van Hooft