Control flow to check for viruses

Skip to first unread message

Marcelo A F Gomes

Oct 5, 2022, 3:03:06 PM10/5/22
to archivematica
Hi. I have a specific question, regarding the control flow in Archivematica, when it comes to checking for viruses:
When I schedule a transfer, it gets stuck in the "Scan for virus" job. While trying to diagnose the problem, I have seen, in the log for the MCP client container, messages that I could interpret as meaning that it has no memory available to execute a fork system call:
04/10/2022 17:44:41
04/10/2022 17:44:41>
04/10/2022 INFO      2022-10-04 20:44:41,765  archivematica.mcp.client:execute_command:208:
04/10/2022 17:44:41
04/10/2022 17:44:41*** RUNNING TASK: archivematicaclamscan_v0.0
04/10/2022 17:44:42Exception in thread Thread-2:
04/10/2022 17:44:42Traceback (most recent call last):
04/10/2022 17:44:42  File "/usr/lib/python2.7/", line 801, in __bootstrap_inner
04/10/2022 17:44:42
04/10/2022 17:44:42  File "/usr/lib/python2.7/", line 754, in run
04/10/2022 17:44:42    self.__target(*self.__args, **self.__kwargs)
04/10/2022 17:44:42  File "/usr/lib/python2.7/multiprocessing/", line 328, in _handle_workers
04/10/2022 17:44:42    pool._maintain_pool()
04/10/2022 17:44:42  File "/usr/lib/python2.7/multiprocessing/", line 232, in _maintain_pool
04/10/2022 17:44:42    self._repopulate_pool()
04/10/2022 17:44:42  File "/usr/lib/python2.7/multiprocessing/", line 225, in _repopulate_pool
04/10/2022 17:44:42    w.start()
04/10/2022 17:44:42  File "/usr/lib/python2.7/multiprocessing/", line 130, in start
04/10/2022 17:44:42    self._popen = Popen(self)
04/10/2022 17:44:42  File "/usr/lib/python2.7/multiprocessing/", line 121, in __init__
04/10/2022 17:44:42 = os.fork()
04/10/2022 17:44:42OSError: [Errno 12] Cannot allocate memory

But, since it's related to the scanning for viruses, I have tried to check the clamav container, and, as far as I could tell, even after running a few sanity checks, the request to scan files never gets to that container.

So, I'd like to understand how the flow of control works, in such a situation.
Does the MCP client requests go through gearmand? And, if so, where do they end up laer on? How does it all work?

I'm lost, trying to read source code. If there's some architectural documentation, please tell me where it lies.
Also, if you could point me to some tool I could use to debug the code, as it gets executed, I'd appreciate very much.

Thanks for any help.
Reply all
Reply to author
0 new messages