Issue Type: Bug Bug
Assignee: sogabe
Components: clamav-plugin
Created: 15/Apr/15 10:53 AM
Description:

During scan of workspace, with a large number of files, ClamAvRecorder abort scan whith Error:

ERROR: Publisher org.jenkinsci.plugins.clamav.ClamAvRecorder aborted due to exception
java.io.FileNotFoundException: /home/sonar/.jenkins/jobs/PJ-PORT_PCPLS/workspace/proj/target/test-classes/generated/RESPONSE$DATA$CPLCOMANDOPL.class (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at hudson.FilePath.read(FilePath.java:1739)
at org.jenkinsci.plugins.clamav.ClamAvRecorder.perform(ClamAvRecorder.java:117)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1784)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)

I analyzed the source code and suggest you to manage the file's close() at

ClamAvScanner.java:97 with insert a finally block.

public ScanResult scan(InputStream file) {
if (file == null) { throw new IllegalArgumentException("file is null."); }
String response;
try { response = instream(file); } catch (IOException e) { return new ScanResult(Status.WARNING, e.getMessage()); } finally { ... file.close(); ... }
if (response.contains("FOUND\0")) { String sig = response.substring("stream: ".length(), response.lastIndexOf("FOUND") - 1); return new ScanResult(Status.INFECTED, sig); }
return new ScanResult(Status.PASSED);
}

Environment: Jenkins ver. 1.596.1
ClamAV Plugin 0.2.1
apache-tomcat-6.0.39
java version jdk1.7.0_55
Project: Jenkins
Priority: Major Major
Reporter: fabio farronato
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to