Hi,
First of all, thanks for this great Alfresco extension.
We plan to deploy it soon on our Alfresco One 5.0 instance, but something in the design of the scan components looks strange to me, perhaps can you help me understand the way the module works ?
Scanning components (InStreamScan, CommandScan) are Spring based "singleton" beans, created in the alfviral-context.xml context definition file.
As Spring beans are similar to singleton, there is only a single instance of each in the Spring application context.
Here is the potential identified risk : when scanning a file, the following code is used in AntivirusService
inStreamScan.setData(contentReader.getContentString().getBytes());
res = inStreamScan.scan(nodeRef);
It works well when a single file is scanned, or if files are scanned sequentially.
But what happens if several files are scanned concurrently ?
As methods are not synchronized, there is a risk to switch to another file between inStreamScan.setData(...) call and inStreamScan.scan(...) call.
And if a scan takes a long time to run, the nodeRef attribute of inStreamScan component may be updated during the scan to another nodeRef.
I may be wrong, as in fact I have not been able to setup a test platform to validate my assomptions.
Did I missed something is this a known limitation ?
Regards.