Skip to content

Commit 40adb93

Browse files
lberkicopybara-github
authored andcommitted
Thread InterruptedException through a few new places.
This makes a badly timed SIGINT that arrives during fingerprint value service instantiation not crash the server. RELNOTES: None. PiperOrigin-RevId: 760599067 Change-Id: I6465d931c290838381fb56144c61914c01ad1ce7
1 parent e953910 commit 40adb93

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,10 +1306,10 @@ public ObjectCodecs getObjectCodecs() {
13061306
}
13071307

13081308
@Override
1309-
public FingerprintValueService getFingerprintValueService() {
1309+
public FingerprintValueService getFingerprintValueService() throws InterruptedException {
13101310
try {
13111311
return fingerprintValueServiceFuture.get(CLIENT_LOOKUP_TIMEOUT_SEC, SECONDS);
1312-
} catch (InterruptedException | ExecutionException | TimeoutException e) {
1312+
} catch (ExecutionException | TimeoutException e) {
13131313
throw new IllegalStateException("Unable to initialize fingerprint value service", e);
13141314
}
13151315
}
@@ -1343,7 +1343,8 @@ public void setTopLevelConfigChecksum(String topLevelConfigChecksum) {
13431343
}
13441344

13451345
@Override
1346-
public ImmutableSet<SkyKey> lookupKeysToInvalidate(Set<SkyKey> keysToLookup) {
1346+
public ImmutableSet<SkyKey> lookupKeysToInvalidate(Set<SkyKey> keysToLookup)
1347+
throws InterruptedException {
13471348
AnalysisCacheInvalidator invalidator = getAnalysisCacheInvalidator();
13481349
if (invalidator == null) {
13491350
return ImmutableSet.of();
@@ -1352,7 +1353,7 @@ public ImmutableSet<SkyKey> lookupKeysToInvalidate(Set<SkyKey> keysToLookup) {
13521353
}
13531354

13541355
@Nullable
1355-
private AnalysisCacheInvalidator getAnalysisCacheInvalidator() {
1356+
private AnalysisCacheInvalidator getAnalysisCacheInvalidator() throws InterruptedException {
13561357
AnalysisCacheInvalidator localRef = analysisCacheInvalidator;
13571358
if (localRef == null) {
13581359
synchronized (this) {

src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,8 @@ public Set<SkyKey> getDeserializedKeysFromRemoteAnalysisCache() {
562562
*
563563
* <p>This is a no-op if remote analysis caching is disabled.
564564
*/
565-
public void invalidateWithExternalService(ExtendedEventHandler eventHandler) {
565+
public void invalidateWithExternalService(ExtendedEventHandler eventHandler)
566+
throws InterruptedException {
566567
if (!isRemoteAnalysisCachingEnabled()) {
567568
return;
568569
}

src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCachingDependenciesProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ default boolean isRemoteFetchEnabled() {
5858
ObjectCodecs getObjectCodecs();
5959

6060
/** Returns the {@link FingerprintValueService} implementation. */
61-
FingerprintValueService getFingerprintValueService();
61+
FingerprintValueService getFingerprintValueService() throws InterruptedException;
6262

6363
RequestBatcher<ByteString, ByteString> getAnalysisCacheClient();
6464

@@ -73,7 +73,8 @@ default boolean isRemoteFetchEnabled() {
7373
*
7474
* <p>May call the remote analysis cache to get the set of keys to invalidate.
7575
*/
76-
ImmutableSet<SkyKey> lookupKeysToInvalidate(Set<SkyKey> existingCachedKeys);
76+
ImmutableSet<SkyKey> lookupKeysToInvalidate(Set<SkyKey> existingCachedKeys)
77+
throws InterruptedException;
7778

7879
/** A stub dependencies provider for when analysis caching is disabled. */
7980
final class DisabledDependenciesProvider implements RemoteAnalysisCachingDependenciesProvider {

0 commit comments

Comments
 (0)