Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
using noop locker as waitlist add is atomic operation
Browse files Browse the repository at this point in the history
  • Loading branch information
pmahindrakar-oss committed May 23, 2024
1 parent c72403d commit 8ae9780
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ require (
)

replace (
github.com/flyteorg/flyte/flyteidl => github.com/flyteorg/flyte/flyteidl v1.12.1-0.20240523071823-0c14c3134146
github.com/flyteorg/flyte/flyteplugins => github.com/flyteorg/flyte/flyteplugins v1.12.1-0.20240523071823-0c14c3134146
github.com/flyteorg/flyte/flytepropeller => github.com/flyteorg/flyte/flytepropeller v1.12.1-0.20240523071823-0c14c3134146
github.com/flyteorg/flyte/flytestdlib => github.com/flyteorg/flyte/flytestdlib v1.12.1-0.20240523071823-0c14c3134146
github.com/flyteorg/flyte/flyteidl => github.com/flyteorg/flyte/flyteidl v1.12.1-0.20240523211648-f1200666f004
github.com/flyteorg/flyte/flyteplugins => github.com/flyteorg/flyte/flyteplugins v1.12.1-0.20240523211648-f1200666f004
github.com/flyteorg/flyte/flytepropeller => github.com/flyteorg/flyte/flytepropeller v1.12.1-0.20240523211648-f1200666f004
github.com/flyteorg/flyte/flytestdlib => github.com/flyteorg/flyte/flytestdlib v1.12.1-0.20240523211648-f1200666f004
)
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flyteorg/flyte/flyteidl v1.12.1-0.20240523071823-0c14c3134146 h1:g1DOLB6yAWKEKZ3IGUFSa//6Iam/9LhW25Kk1WfvA/A=
github.com/flyteorg/flyte/flyteidl v1.12.1-0.20240523071823-0c14c3134146/go.mod h1:ki0nYf4mHM5VyaXY3lpndDSRqvUvmqlnyLENVu06dSQ=
github.com/flyteorg/flyte/flyteplugins v1.12.1-0.20240523071823-0c14c3134146 h1:IFbJtEsNQIzyXXttW5Vf/MLtHBtgXFKM2AFeZq5QvlE=
github.com/flyteorg/flyte/flyteplugins v1.12.1-0.20240523071823-0c14c3134146/go.mod h1:Zr3nUQN5FREE0Qzg0MteW2H46YFKYJMiu6F8oPmU46g=
github.com/flyteorg/flyte/flytepropeller v1.12.1-0.20240523071823-0c14c3134146 h1:9BSCucnTkSgmKHrjLl++i9sxcxQhqUlMiNu1TUQHTdc=
github.com/flyteorg/flyte/flytepropeller v1.12.1-0.20240523071823-0c14c3134146/go.mod h1:Pqr+Usd2CPO/nynhy1O2zEzyLZerVflH80N/k9H89Ag=
github.com/flyteorg/flyte/flytestdlib v1.12.1-0.20240523071823-0c14c3134146 h1:z5ZIp4xDO3UNbRJu2sE/y098T4J7IH5sHTroqBswaDI=
github.com/flyteorg/flyte/flytestdlib v1.12.1-0.20240523071823-0c14c3134146/go.mod h1:l1mK3nAptXTkVBKtrYT3v0ezLJj6BtgfBs/5ywPrO8o=
github.com/flyteorg/flyte/flyteidl v1.12.1-0.20240523211648-f1200666f004 h1:n3WS5FqdV3Esxu2/5+ncafqfe0Po9Py5QsZ+T3RP3j4=
github.com/flyteorg/flyte/flyteidl v1.12.1-0.20240523211648-f1200666f004/go.mod h1:ki0nYf4mHM5VyaXY3lpndDSRqvUvmqlnyLENVu06dSQ=
github.com/flyteorg/flyte/flyteplugins v1.12.1-0.20240523211648-f1200666f004 h1:d06Og4tFDDkOETeSwac6209HUnhPPiFpQQcsYGzV+n8=
github.com/flyteorg/flyte/flyteplugins v1.12.1-0.20240523211648-f1200666f004/go.mod h1:Zr3nUQN5FREE0Qzg0MteW2H46YFKYJMiu6F8oPmU46g=
github.com/flyteorg/flyte/flytepropeller v1.12.1-0.20240523211648-f1200666f004 h1:DS6KgCKYTP97zOXfeI38wFN1dS2jv9It3gSQUwI9t1A=
github.com/flyteorg/flyte/flytepropeller v1.12.1-0.20240523211648-f1200666f004/go.mod h1:Pqr+Usd2CPO/nynhy1O2zEzyLZerVflH80N/k9H89Ag=
github.com/flyteorg/flyte/flytestdlib v1.12.1-0.20240523211648-f1200666f004 h1:xYylOmZyz58p0FiuzerJ6C+DOP6AYjmKJUBtY9KAQNM=
github.com/flyteorg/flyte/flytestdlib v1.12.1-0.20240523211648-f1200666f004/go.mod h1:l1mK3nAptXTkVBKtrYT3v0ezLJj6BtgfBs/5ywPrO8o=
github.com/flyteorg/stow v0.3.10 h1:uEe+tI+CGKn21H93uXp9z05hqynEki2BO9KkW/GweY8=
github.com/flyteorg/stow v0.3.10/go.mod h1:fArjMpsYJNWkp/hyDKKdbcv07gxbuLmKFcb7YT1aSOM=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
Expand Down
7 changes: 6 additions & 1 deletion pkg/pkce/token_cache_keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"fmt"
"sync"

"github.com/flyteorg/flyte/flyteidl/clients/go/admin/cache"
"github.com/flyteorg/flyte/flytestdlib/logger"

"github.com/zalando/go-keyring"
"golang.org/x/oauth2"
)
Expand All @@ -21,6 +23,7 @@ type TokenCacheKeyringProvider struct {
ServiceName string
ServiceUser string
mu *sync.Mutex
condLocker *cache.NoopLocker
cond *sync.Cond
}

Expand Down Expand Up @@ -105,9 +108,11 @@ func (t *TokenCacheKeyringProvider) GetToken() (*oauth2.Token, error) {
}

func NewTokenCacheKeyringProvider(serviceName, serviceUser string) *TokenCacheKeyringProvider {
condLocker := &cache.NoopLocker{}
return &TokenCacheKeyringProvider{
mu: &sync.Mutex{},
cond: sync.NewCond(&sync.Mutex{}),
condLocker: condLocker,
cond: sync.NewCond(condLocker),
ServiceName: serviceName,
ServiceUser: serviceUser,
}
Expand Down

0 comments on commit 8ae9780

Please sign in to comment.