@@ -587,6 +587,8 @@ public PooledSessionFuture replaceSession(
587
587
}
588
588
}
589
589
590
+ // Suppressed for initial Error Prone rollout.
591
+ @ SuppressWarnings ("GuardedBy" )
590
592
@ Override
591
593
public PooledSessionFuture denyListSession (
592
594
RetryOnDifferentGrpcChannelException retryException , PooledSessionFuture session ) {
@@ -1768,6 +1770,8 @@ public ApiFuture<Empty> asyncClose() {
1768
1770
return ApiFutures .immediateFuture (Empty .getDefaultInstance ());
1769
1771
}
1770
1772
1773
+ // Suppressed for initial Error Prone rollout.
1774
+ @ SuppressWarnings ("GuardedBy" )
1771
1775
@ Override
1772
1776
public void close () {
1773
1777
synchronized (lock ) {
@@ -1848,12 +1852,16 @@ public SessionImpl getDelegate() {
1848
1852
return this .delegate ;
1849
1853
}
1850
1854
1855
+ // Suppressed for initial Error Prone rollout.
1856
+ @ SuppressWarnings ("GuardedBy" )
1851
1857
@ Override
1852
1858
public void markBusy (ISpan span ) {
1853
1859
this .delegate .setCurrentSpan (span );
1854
1860
this .state = SessionState .BUSY ;
1855
1861
}
1856
1862
1863
+ // Suppressed for initial Error Prone rollout.
1864
+ @ SuppressWarnings ("GuardedBy" )
1857
1865
private void markClosing () {
1858
1866
this .state = SessionState .CLOSING ;
1859
1867
}
@@ -2091,6 +2099,8 @@ void maintainPool() {
2091
2099
removeLongRunningSessions (currTime );
2092
2100
}
2093
2101
2102
+ // Suppressed for initial Error Prone rollout.
2103
+ @ SuppressWarnings ("GuardedBy" )
2094
2104
private void removeIdleSessions (Instant currTime ) {
2095
2105
synchronized (lock ) {
2096
2106
// Determine the minimum last use time for a session to be deemed to still be alive. Remove
@@ -2190,6 +2200,8 @@ void removeLongRunningSessions(Instant currentTime) {
2190
2200
}
2191
2201
}
2192
2202
2203
+ // Suppressed for initial Error Prone rollout.
2204
+ @ SuppressWarnings ("GuardedBy" )
2193
2205
private void removeLongRunningSessions (
2194
2206
final Instant currentTime ,
2195
2207
final InactiveTransactionRemovalOptions inactiveTransactionRemovalOptions ) {
@@ -2691,6 +2703,8 @@ private void invalidateSession(PooledSession session) {
2691
2703
}
2692
2704
}
2693
2705
2706
+ // Suppressed for initial Error Prone rollout.
2707
+ @ SuppressWarnings ("GuardedBy" )
2694
2708
private Tuple <PooledSession , Integer > findSessionToKeepAlive (
2695
2709
Queue <PooledSession > queue , Instant keepAliveThreshold , int numAlreadyChecked ) {
2696
2710
int numChecked = 0 ;
@@ -2885,6 +2899,8 @@ private void releaseSession(PooledSession session, boolean isNewSession) {
2885
2899
}
2886
2900
2887
2901
/** Releases a session back to the pool. This might cause one of the waiters to be unblocked. */
2902
+ // Suppressed for initial Error Prone rollout.
2903
+ @ SuppressWarnings ("GuardedBy" )
2888
2904
private void releaseSession (
2889
2905
PooledSession session , boolean isNewSession , @ Nullable Integer position ) {
2890
2906
Preconditions .checkNotNull (session );
@@ -2945,13 +2961,17 @@ private void releaseSession(
2945
2961
* running many small, quick queries using a small number of parallel threads. This can cause a
2946
2962
* high TPS, without actually having a high degree of parallelism.
2947
2963
*/
2964
+ // Suppressed for initial Error Prone rollout.
2965
+ @ SuppressWarnings ("GuardedBy" )
2948
2966
@ VisibleForTesting
2949
2967
boolean shouldRandomize () {
2950
2968
return this .options .getRandomizePositionQPSThreshold () > 0
2951
2969
&& this .transactionsPerSecond >= this .options .getRandomizePositionQPSThreshold ()
2952
2970
&& this .numSessionsInUse >= this .numChannels ;
2953
2971
}
2954
2972
2973
+ // Suppressed for initial Error Prone rollout.
2974
+ @ SuppressWarnings ("GuardedBy" )
2955
2975
private boolean isUnbalanced (PooledSession session ) {
2956
2976
int channel = session .getChannel ();
2957
2977
int numChannels = sessionClient .getSpanner ().getOptions ().getNumChannels ();
@@ -3054,10 +3074,14 @@ private void handleCreateSessionsFailure(SpannerException e, int count) {
3054
3074
}
3055
3075
}
3056
3076
3077
+ // Suppressed for initial Error Prone rollout.
3078
+ @ SuppressWarnings ("GuardedBy" )
3057
3079
void setResourceNotFoundException (ResourceNotFoundException e ) {
3058
3080
this .resourceNotFoundException = MoreObjects .firstNonNull (this .resourceNotFoundException , e );
3059
3081
}
3060
3082
3083
+ // Suppressed for initial Error Prone rollout.
3084
+ @ SuppressWarnings ("GuardedBy" )
3061
3085
private void decrementPendingClosures (int count ) {
3062
3086
pendingClosure -= count ;
3063
3087
if (pendingClosure == 0 ) {
@@ -3070,6 +3094,8 @@ private void decrementPendingClosures(int count) {
3070
3094
* {@code IllegalStateException}. The returned future blocks till all the sessions created in this
3071
3095
* pool have been closed.
3072
3096
*/
3097
+ // Suppressed for initial Error Prone rollout.
3098
+ @ SuppressWarnings ("GuardedBy" )
3073
3099
ListenableFuture <Void > closeAsync (ClosedException closedException ) {
3074
3100
ListenableFuture <Void > retFuture = null ;
3075
3101
synchronized (lock ) {
@@ -3269,6 +3295,8 @@ public void onSessionCreateFailure(Throwable t, int createFailureForSessionCount
3269
3295
* Initializes and creates Spanner session relevant metrics using OpenCensus. When coupled with an
3270
3296
* exporter, it allows users to monitor client behavior.
3271
3297
*/
3298
+ // Suppressed for initial Error Prone rollout.
3299
+ @ SuppressWarnings ("GuardedBy" )
3272
3300
private void initOpenCensusMetricsCollection (
3273
3301
MetricRegistry metricRegistry ,
3274
3302
List <LabelValue > labelValues ,
@@ -3402,6 +3430,8 @@ private void initOpenCensusMetricsCollection(
3402
3430
* Initializes and creates Spanner session relevant metrics using OpenTelemetry. When coupled with
3403
3431
* an exporter, it allows users to monitor client behavior.
3404
3432
*/
3433
+ // Suppressed for initial Error Prone rollout.
3434
+ @ SuppressWarnings ("GuardedBy" )
3405
3435
private void initOpenTelemetryMetricsCollection (
3406
3436
OpenTelemetry openTelemetry ,
3407
3437
Attributes attributes ,
0 commit comments