Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Improve stability of managing multiple resources in parallel #15

Merged
merged 2 commits into from
Oct 14, 2020

Conversation

invidian
Copy link
Contributor

Currently due tinkerbell/tink#338, Terraform often return errors if multiple resources are managed in parallel. This PR aims to add some mitigation against that.

This commit makes sure that testing configuration generates unique
resource names, so multiple outputs can be combined and executed by
Terraform in parallel.

As a preparation to test mitigations against
tinkerbell/tink#338.

Signed-off-by: Mateusz Gozdek <[email protected]>
To mitigate tinkerbell/tink#338, as most
likely retrying should be happening on server side, not client size.

It seems 'database/sql' used by Tink does not export serialization error
constant, so we use string matching to check for errors.

Checking is strict and should only match only the actual error we want
to retry on.

Currently, retrying has no limit, as depending on the number of parallel
clients, error still may occur. This may potentially lead to the
spinlock if deploying with many clients in parallel talking to single Tink
server, however, this is not considered for the time being.

No retry limit will also ensure, that single client will be able to
apply all operations (basically drain the operations "queue"), no matter
how many operations are done in parallel.

Signed-off-by: Mateusz Gozdek <[email protected]>
@invidian invidian force-pushed the invidian/test-parallel-creation branch from 695fec7 to d4e4080 Compare October 12, 2020 12:41
@invidian invidian marked this pull request as ready for review October 12, 2020 12:47
@invidian invidian merged commit f84db9b into master Oct 14, 2020
@invidian invidian deleted the invidian/test-parallel-creation branch October 14, 2020 14:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant