@@ -40,7 +40,15 @@ class Registry {
40
40
`${ groupId . replaceAll ( "." , "/" ) } /${ artifactId } /${ optionalVersion } maven-metadata.xml` ;
41
41
42
42
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
+ } ) ;
44
52
if ( ! res . ok ) {
45
53
throw new Error ( `[HTTP Error] ${ res . status } ${ res . statusText } ` ) ;
46
54
}
@@ -84,7 +92,15 @@ class Registry {
84
92
85
93
log . verbose ( `Fetching: ${ url } ` ) ;
86
94
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 ,
88
104
} ) ;
89
105
if ( ! res . ok ) {
90
106
throw new Error ( `[HTTP Error] ${ res . status } ${ res . statusText } ` ) ;
0 commit comments