Skip to content

Commit

Permalink
Delete ancient obsolete unused code.
Browse files Browse the repository at this point in the history
Change semaphore usage to less restrictive tryAcquire to unblock session manager lockings.

PiperOrigin-RevId: 580672574
Change-Id: I83d0bad6c9fe5143b7280347edecb7b8f630ce4d
  • Loading branch information
ludoch authored and gae-java-bot committed Nov 8, 2023
1 parent dee15d4 commit 55e72c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 251 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ public LocalRpcService getLocalService(String packageName) {

private static final Logger logger = Logger.getLogger(ApiProxyLocalImpl.class.getName());

private final Map<String, LocalRpcService> serviceCache =
new ConcurrentHashMap<String, LocalRpcService>();
private final Map<String, LocalRpcService> serviceCache = new ConcurrentHashMap<>();

private final Map<String, Method> methodCache = new ConcurrentHashMap<String, Method>();
final Map<Method, LatencySimulator> latencySimulatorCache =
Expand Down Expand Up @@ -204,12 +203,10 @@ public Future<byte[]> makeAsyncCall(
Semaphore semaphore = (Semaphore) environment.getAttributes().get(
LocalEnvironment.API_CALL_SEMAPHORE);
if (semaphore != null) {
try {
semaphore.acquire();
} catch (InterruptedException ex) {
// We never do this, so just propagate it as a RuntimeException for now.
throw new RuntimeException("Interrupted while waiting on semaphore:", ex);
}
// TODO: investigate why the acquire() locks when Sessions are configured in appengine-web.xml
// Maybe the semaphore has been released just before the app engine session manager starts
// saving the data in datastore.
semaphore.tryAcquire();
}
AsyncApiCall asyncApiCall =
new AsyncApiCall(environment, packageName, methodName, requestBytes, semaphore);
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 55e72c9

Please sign in to comment.