pulumi/pkg/backend
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
..
display Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
diy Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
filestate Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
httpstate Keep the token source loop going in the face of errors (#17519) 2024-10-08 15:16:04 +00:00
state [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
apply.go Fix rendering of output events in rendering update diffs (#17029) 2024-08-27 18:37:03 +00:00
apply_test.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
backend.go Respect existing stack configuration when initialising secret managers (#17465) 2024-10-03 15:40:39 +00:00
backend_test.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
cancellation_scope.go Allow cancelling operations with SIGTERM (#17467) 2024-10-07 13:49:04 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
errors.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
inmemoryPersister.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
login_manager.go Add LoginManager to backend package (#17199) 2024-09-10 09:04:49 +00:00
mock.go Respect existing stack configuration when initialising secret managers (#17465) 2024-10-03 15:40:39 +00:00
policypack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
query.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
snapshot.go Introduce snapshot metadata (#17430) 2024-09-30 16:45:40 +00:00
snapshot_test.go Introduce snapshot metadata (#17430) 2024-09-30 16:45:40 +00:00
stack.go Allow `Backend`s to define `DefaultSecretManager`s (#17370) 2024-09-26 08:52:24 +00:00
updates.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
watch.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00