Skip to content

Commit b060ee8

Browse files
authored
🐛 [parallelisation] Make sure options are not overridden for a close store (#678)
<!-- Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved. SPDX-License-Identifier: Apache-2.0 --> ### Description - close stores require to be used slightly differently to what they used to. ### Test Coverage <!-- Please put an `x` in the correct box e.g. `[x]` to indicate the testing coverage of this change. --> - [x] This change is covered by existing or additional automated tests. - [ ] Manual testing has been performed (and evidence provided) as automated testing was not feasible. - [ ] Additional tests are not required for this change (e.g. documentation update).
1 parent 06ae620 commit b060ee8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

changes/20250814104556.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:bug: [parallelisation] Make sure options are not overridden for a close store

utils/parallelisation/onclose.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewCloserStore(stopOnFirstError bool) *CloserStore {
2929
if stopOnFirstError {
3030
option = StopOnFirstError
3131
}
32-
return NewCloserStoreWithOptions(option, Parallel)
32+
return NewCloserStoreWithOptions(option, Parallel, RetainAfterExecution)
3333
}
3434

3535
// NewCloserStoreWithOptions returns a store of io.Closer object which will all be closed on Close(). The first error received if any will be returned
@@ -40,7 +40,7 @@ func NewCloserStoreWithOptions(opts ...StoreOption) *CloserStore {
4040
return commonerrors.UndefinedVariable("closer object")
4141
}
4242
return closerObj.Close()
43-
}, append(opts, RetainAfterExecution)...),
43+
}, opts...),
4444
}
4545
}
4646

@@ -125,7 +125,7 @@ func NewCloseFunctionStore(options ...StoreOption) *CloseFunctionStore {
125125
return &CloseFunctionStore{
126126
store: *newFunctionStore[CloseFunc](func(_ context.Context, closerObj CloseFunc) error {
127127
return closerObj()
128-
}, append(options, RetainAfterExecution)...),
128+
}, options...),
129129
}
130130
}
131131

@@ -141,5 +141,5 @@ func NewConcurrentCloseFunctionStore(stopOnFirstError bool) *CloseFunctionStore
141141
if stopOnFirstError {
142142
option = StopOnFirstError
143143
}
144-
return NewCloseFunctionStore(option, Parallel)
144+
return NewCloseFunctionStore(option, Parallel, RetainAfterExecution)
145145
}

0 commit comments

Comments
 (0)