Skip to content

fix(spanner): cache auto-tagging options to avoid system property lock contention#13273

Merged
sakthivelmanii merged 1 commit into
mainfrom
fix-spanner-autotagging-cache
May 27, 2026
Merged

fix(spanner): cache auto-tagging options to avoid system property lock contention#13273
sakthivelmanii merged 1 commit into
mainfrom
fix-spanner-autotagging-cache

Conversation

@sakthivelmanii
Copy link
Copy Markdown
Contributor

No description provided.

@sakthivelmanii sakthivelmanii requested review from a team as code owners May 26, 2026 19:35
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors how auto-tagging options are initialized and checked in SpannerOptions to resolve system property lock contention. However, removing the public method isAutoTaggingDisabled() introduces a breaking change to the public API. The feedback suggests caching the disabled status in a new private field during construction to safely preserve this public method without re-introducing the performance issue.

Comment on lines 2628 to -2630

public boolean isAutoTaggingDisabled() {
return environment.isAutoTaggingDisabled();
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Removing the public method isAutoTaggingDisabled() is a breaking change for the public API of SpannerOptions. To avoid breaking backward compatibility while still preventing system property lock contention, we should keep this method and return a cached value.

Note: You will also need to declare private final boolean autoTaggingDisabled; as a field in the class.

Suggested change
public boolean isAutoTaggingDisabled() {
return environment.isAutoTaggingDisabled();
}
public boolean isAutoTaggingDisabled() {
return autoTaggingDisabled;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change is not live yet

@sakthivelmanii sakthivelmanii merged commit dc2feed into main May 27, 2026
178 checks passed
@sakthivelmanii sakthivelmanii deleted the fix-spanner-autotagging-cache branch May 27, 2026 00:49
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.

2 participants