Skip to content
Closed
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: 8 additions & 0 deletions aiida/manage/external/rmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
###########################################################################
# pylint: disable=cyclic-import
"""Components to communicate tasks to RabbitMQ."""
import asyncio
from collections.abc import Mapping
import gc
import logging

from kiwipy import communications, Future
Expand Down Expand Up @@ -220,4 +222,10 @@ async def _continue(self, communicator, pid, nowait, tag=None):
LOGGER.exception('failed to serialize the result for process<%d>', pid)
raise

# before returning we ensure the garbage collection runs, to clear any memory used by the task
await asyncio.sleep(1) # allow other async tasks to complete first
del node
del result
gc.collect()

return serialized