[FIX] Catch ConnectException in httpGetFile rather downloadPOM methods.
@@ -83,11 +83,6 @@ public class MavenUtilities {
try {
File pom = httpGetToFile(pomUrl);
return Optional.of(pom);
- } catch (ConnectException e1) {
- // After downloading ~50-60K POMs, there will be a lot of CLOSE_WAIT connections,
- // at some point the plug-in runs out of source ports to use. Therefore, we need to crash so that
- // Kubernetes will restart the plug-in to kill CLOSE_WAIT connections.
- throw new Error("Failing execution, typically due to many CLOSE_WAIT connections", e1);
} catch (IOException e2) {
continue;
}
@@ -147,6 +142,11 @@ public class MavenUtilities {
}
// TODO why this complicated construct and not just return tempFile?
return tempFile.toAbsolutePath().toFile();
+ } catch (ConnectException e) {
+ // After downloading ~50-60K POMs, there will be a lot of CLOSE_WAIT connections,
+ // at some point the plug-in runs out of source ports to use. Therefore, we need to crash so that
+ // Kubernetes will restart the plug-in to kill CLOSE_WAIT connections.
+ throw new Error("Failing execution, typically due to many CLOSE_WAIT connections", e);
} catch (IOException e) {
logger.error("Error getting file from URL: " + url, e);
throw e;
