Skip to content

Commit f546ec0

Browse files
committed
Make readOnlyBearerAuth volatile to prevent data races when executing concurrently doPullBearerAuth() and/or doPushBearerAuth()
1 parent ec548da commit f546ec0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static Multimap<String, String> decodeTokenRepositoryGrants(String token) {
237237

238238
// mutable
239239
private final AtomicReference<Authorization> authorization = new AtomicReference<>();
240-
private boolean readOnlyBearerAuth;
240+
private volatile boolean readOnlyBearerAuth;
241241
private final AtomicReference<RegistryAuthenticator> initialBearerAuthenticator =
242242
new AtomicReference<>();
243243

0 commit comments

Comments
 (0)