Skip to content

Added StateStore to timeouts#222

Open
rainkwan wants to merge 3 commits intomainfrom
rk/statestore-timeouts
Open

Added StateStore to timeouts#222
rainkwan wants to merge 3 commits intomainfrom
rk/statestore-timeouts

Conversation

@rainkwan
Copy link
Contributor

Related Issue

Description

Added StateStore to timeouts package

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

No

@rainkwan rainkwan requested a review from a team as a code owner February 23, 2026 14:40
Comment on lines +7 to +8
github.com/hashicorp/terraform-plugin-framework v1.17.1-0.20260223163459-7b6eb103b2e8
github.com/hashicorp/terraform-plugin-go v0.29.1-0.20260122204301-b0a6aca80fd7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need to wait for Framework and plugin-go to be released until we merge this PR (or at least until we release the timeouts package after merging this)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this PR just needs to be rebased and it'll bring in the right framework Go module 👍🏻

Comment on lines +7 to +8
github.com/hashicorp/terraform-plugin-framework v1.17.1-0.20260223163459-7b6eb103b2e8
github.com/hashicorp/terraform-plugin-go v0.29.1-0.20260122204301-b0a6aca80fd7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this PR just needs to be rebased and it'll bring in the right framework Go module 👍🏻

Comment on lines +110 to +114
// StateStore attempts to retrieve the "statestore" attribute and parse it as time.Duration.
// If any diagnostics are generated they are returned along with the supplied default timeout.
func (t Value) StateStore(ctx context.Context, defaultTimeout time.Duration) (time.Duration, diag.Diagnostics) {
return t.getTimeout(ctx, attributeNameStateStore, defaultTimeout)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this highlights a question about what exactly timeouts would be used for in state stores. This method/usage should be named based on the actual operation where the timeout data is relevant, not the name of the type itself.

For example:


So for state stores, it should be named based on which operation the timeout is relevant to (Read, Write, Lock, Unlock, etc.): https://github.com/hashicorp/terraform-plugin-framework/blob/c957640a318c5f774bafc672a6db0fee71a638f8/statestore/statestore.go#L20-L54


If there isn't a clear idea, I think it's also reasonable to just wait until there is an ask to implement this

)

const (
attributeNameStateStore = "statestore"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment, but this should be related to the operation the timeout applies to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants