Skip to content

feat(sfs): make share wait timeouts configurable - #1767

Closed
devpie wants to merge 2 commits into
stackitcloud:mainfrom
devpie:feat/sfs-share-timeouts
Closed

devpie wants to merge 2 commits into
stackitcloud:mainfrom
devpie:feat/sfs-share-timeouts

Conversation

@devpie

@devpie devpie commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Description

relates to #1737

stackit_sfs_share has the problem #1740 fixed for stackit_sfs_resource_pool: CreateShareWaitHandler and its update and delete counterparts set SetTimeout(10 * time.Minute), and the resource passed a context without a deadline, so that default was the only limit and no configuration could reach it.

This adds the timeouts attribute in the same shape as #1740:

  • resource: create, read, update, delete; data source: read
  • the default stays at the wait handler's own timeout plus core.DefaultTimeoutMargin, so unconfigured resources keep their current behaviour
  • each CRUD method sets a context deadline, which is what the SDK waiter honours: it applies its own timeout only when the incoming context carries none
  • a wait that ends on the deadline names the configured timeout through utils.TimeoutHint, the helper feat(sfs): make resource pool wait timeouts configurable #1740 put in stackit/internal/utils

TestSfsShareCreateTimeout mirrors TestSfsResourcePoolCreateTimeout. testdata/share-max.tf and the max acceptance test configure timeouts, so TestAccShareResourceMax covers the attribute across create, import-verify and update.

One wording note: the update wait keeps its share get detail instead of following the resource pool's resource pool update waiting. UpdateShareWaitHandler polls GetShare until the share reaches created, and a share has no updating state (sfs@v0.11.2 documents pending, creating, created, error, deleting), so after a PATCH the first poll normally returns straight away. Happy to align the wording with the resource pool if you prefer the symmetry.

Overlaps by one line with #1766, which corrects the update diagnostics of the same file. If that one merges first, this branch rebases with a trivial resolution.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory) — deliberately not: no example in examples/ carries a timeouts block, and feat(dns) add timeouts to dns resources and datasources #1345, which added timeouts to the DNS resources, put the demonstrable configuration in testdata instead
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@devpie
devpie requested a review from a team as a code owner September 14, 2026 12:58
stackit_sfs_share could not create, update or delete a share that takes
longer than the 10 minutes the SDK wait handlers set, because the resource
passed a context without a deadline and the handler default was the only
limit. This adds a timeouts attribute following stackitcloud#1740: the default is the
wait handler's own timeout plus core.DefaultTimeoutMargin, each CRUD method
bounds its context, and a failing wait names the configured timeout through
utils.TimeoutHint. The data source gets the read timeout.
With all four timeouts at 10ms the test passed even when Create read the
wrong key from the timeouts block. Only create stays short now, so the test
fails if the create path stops using timeouts.create.
@devpie
devpie force-pushed the feat/sfs-share-timeouts branch from 97bbc60 to cb22f44 Compare September 15, 2026 08:13
@devpie devpie closed this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants