| Matt Murphy Thanks! I debugged further and I think I found where issue is. https://github.com/jenkinsci/ibm-asoc-plugin/blob/ibm-application-security-1.3.0/src/main/java/com/hcl/appscan/jenkins/plugin/actions/ResultsRetriever.java#L64-L79
public boolean getHasResults() {
return checkResults(m_build);
}
public boolean checkResults(Run<?,?> r) {
if(r.getAllActions().contains(this) && m_provider.hasResults()) {
r.getActions().remove(this); //We need to remove this action from the build, but getAllActions() returns a read-only list.
r.addAction(createResults());
try {
r.save();
} catch (IOException e) {
}
return true;
}
return false;
}
Here m_provider.hasResults() is doing synchronous HTTP request and taking some time to complete. If hasResults() returns true, logic proceeds to createResults(). createResults() method creates new ScanResults object but during construction of this object, getReport() method is called. This method is also doing synchronous HTTP request for retrieving HTML scan report and taking some time to complete. https://github.com/jenkinsci/ibm-asoc-plugin/blob/ibm-application-security-1.3.0/src/main/java/com/hcl/appscan/jenkins/plugin/actions/ScanResults.java#L45-L58
public ScanResults(Run<?,?> build, IResultsProvider provider, String name, String status,
int totalFindings, int highCount, int mediumCount, int lowCount, int infoCount) {
super(build.getParent());
m_build = build;
m_provider = provider;
m_name = name;
m_status = status;
m_totalFindings = totalFindings;
m_highCount = highCount;
m_mediumCount = mediumCount;
m_lowCount = lowCount;
m_infoCount = infoCount;
getReport();
}
If we run one scan during build, maybe this is not a problem, but if we run several scans during build synchronous HTTP requests are causing some mess like 504 Gateway Timeout error. I think at least getReport() method should do asynchronous HTTP request. |