Skip to content

Commit 3de767f

Browse files
committed
[FIX] maven/Registry: Prevent socket timeouts when installing framework libraries
Applying the fix from #579 in the Maven Registry module
1 parent 7681a62 commit 3de767f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

lib/ui5Framework/maven/Registry.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ class Registry {
4040
`${groupId.replaceAll(".", "/")}/${artifactId}/${optionalVersion}maven-metadata.xml`;
4141

4242
log.verbose(`Fetching: ${url}`);
43-
const res = await fetch(url);
43+
const res = await fetch(url, {
44+
// Disable usage of shared keep-alive agents.
45+
// make-fetch-happen uses a hard-coded 15 seconds freeSocketTimeout
46+
// that can be easily reached (Error: Socket timeout) and there doesn't
47+
// seem to be another way to disable or increase it.
48+
// Also see: https://github.com/node-modules/agentkeepalive/issues/106
49+
// The same applies in npm/Registry.js
50+
agent: false,
51+
});
4452
if (!res.ok) {
4553
throw new Error(`[HTTP Error] ${res.status} ${res.statusText}`);
4654
}
@@ -84,7 +92,15 @@ class Registry {
8492

8593
log.verbose(`Fetching: ${url}`);
8694
const res = await fetch(url, {
87-
cache: "no-store" // Do not cache these large artifacts. We store them right away anyways
95+
cache: "no-store", // Do not cache these large artifacts. We store them right away anyways
96+
97+
// Disable usage of shared keep-alive agents.
98+
// make-fetch-happen uses a hard-coded 15 seconds freeSocketTimeout
99+
// that can be easily reached (Error: Socket timeout) and there doesn't
100+
// seem to be another way to disable or increase it.
101+
// Also see: https://github.com/node-modules/agentkeepalive/issues/106
102+
// The same applies in npm/Registry.js
103+
agent: false,
88104
});
89105
if (!res.ok) {
90106
throw new Error(`[HTTP Error] ${res.status} ${res.statusText}`);

0 commit comments

Comments
 (0)