pulumi/pkg/backend/httpstate
Thomas Gummerer a437b90a5e
Keep the token source loop going in the face of errors (#17519)
Currently the token source loop will stop if `refreshToken` ever returns
an error, regardless of what that error is. While the API call to the
service does have some retry logic at it's level it can still
potentially return an error just due to transient network/server
conditions. In that case the refreh loop will just stop working and the
token will eventually expire.

This changes the token source to keep going until it gets a specific
`expiredTokenError` error. This should make it more resilient to network
issues.

Towards fixing https://github.com/pulumi/pulumi/issues/7094.

(This is basically a revert of the revert of
https://github.com/pulumi/pulumi/pull/17127, and adds a little bit more
logging. We reverted that PR originally because something was causing
excessive requests to the service. However I believe what actually
caused the excessive requests was
https://github.com/pulumi/pulumi/pull/17338. Everything in this PR only
runs once every (duration / 8), which is roughly every 40 sec, which
won't overwhelm the service). This also adds a little bit of additional
logging to shed light on this.

---------

Co-authored-by: Fraser Waters <fraser@pulumi.com>
Co-authored-by: Will Jones <will@sacharissa.co.uk>
2024-10-08 15:16:04 +00:00
..
client Add explanations about features to improve UX (#17307) 2024-09-26 14:40:51 +00:00
testdata [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
backend.go Respect existing stack configuration when initialising secret managers (#17465) 2024-10-03 15:40:39 +00:00
backend_test.go Let `Backend.CreateStack` accept an initial state (#17369) 2024-09-26 08:00:52 +00:00
console.go Add support for a PULUMI_CONSOLE_DOMAIN env var (#4410) 2020-04-17 11:50:00 -07:00
console_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diffs.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_post_1.20.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
diffs_pre_1.20.go [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
environments.go Merge ESC Projects feature branch (#17226) 2024-09-10 23:08:09 +00:00
mock.go Update pu/pu to support deployment run command (#16492) 2024-07-01 14:18:44 +00:00
policypack.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
snapshot.go Lift context parameter to SerializeDeployment/Resource/Operations/Properties (#15929) 2024-04-15 07:45:46 +00:00
snapshot_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
stack.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
state.go Keep the token source loop going in the face of errors (#17519) 2024-10-08 15:16:04 +00:00
token_source.go Keep the token source loop going in the face of errors (#17519) 2024-10-08 15:16:04 +00:00
token_source_test.go Keep the token source loop going in the face of errors (#17519) 2024-10-08 15:16:04 +00:00