Commit a2e67eb
Fix S3 lookup unbounded pagination with double call (#6851)
* Fix S3ObjectSummaryLookup causing unbounded pagination on large prefixes
The lookup method paginated through all objects under an S3 prefix
(maxKeys=250) to check path existence. On prefixes with millions of
objects this caused the main thread to hang for minutes parsing massive
XML responses.
Observed in production: nf-schema parameter validation calls
Files.exists() on an S3 outdir path, which triggers
S3ObjectSummaryLookup.lookup. With a large prefix like
s3://bucket/results containing many objects from previous runs,
the pagination loop iterated indefinitely.
Fix: use maxKeys=2 and remove pagination. The matchName check only
needs to find the exact key or its first child (key + "/"), which
are guaranteed to appear in the first results due to S3 lexicographic
ordering.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
* add a second call to ensure directory are found when keys with same prefix and smaller lexico order characters than /
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
* Add inline comments explaining S3 lookup rationale [ci skip]
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
---------
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 4a06f70 commit a2e67eb
File tree
2 files changed
+92
-29
lines changed- plugins/nf-amazon/src
- main/nextflow/cloud/aws/nio/util
- test/nextflow/cloud/aws/nio
2 files changed
+92
-29
lines changedLines changed: 70 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
87 | 71 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 72 | + | |
| 73 | + | |
93 | 74 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
98 | 108 | | |
99 | 109 | | |
100 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
101 | 142 | | |
102 | 143 | | |
103 | 144 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1435 | 1457 | | |
0 commit comments