fix(spanner): cache auto-tagging options to avoid system property lock contention#13273
Conversation
There was a problem hiding this comment.
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.
|
|
||
| public boolean isAutoTaggingDisabled() { | ||
| return environment.isAutoTaggingDisabled(); | ||
| } |
There was a problem hiding this comment.
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.
| public boolean isAutoTaggingDisabled() { | |
| return environment.isAutoTaggingDisabled(); | |
| } | |
| public boolean isAutoTaggingDisabled() { | |
| return autoTaggingDisabled; | |
| } |
There was a problem hiding this comment.
This change is not live yet
No description provided.