GoogleCloudPlatform / appengine-java-standard

Google App Engine Standard Java runtime: Prod runtime, local devappserver, Cloud SDK Java components, GAE APIs, and GAE API emulators.
Apache License 2.0
197 stars 45 forks source link

HTTPConnector mode: Servlet session datastore.put() call to save the session is flaky #279

Open ludoch opened 1 month ago

ludoch commented 1 month ago

Sometimes, when servlet sessions are enabled, the app gets an error in the like:

com.google.apphosting.api.ApiProxy$CancelledException: The API call datastore_v3.Put() was explicitly cancelled. at com.google.apphosting.utils.runtime.ApiProxyUtils.convertApiError(ApiProxyUtils.java:75) at com.google.apphosting.utils.runtime.ApiProxyUtils.getApiError(ApiProxyUtils.java:202) at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.success(ApiProxyImpl.java:691) at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.success(ApiProxyImpl.java:588) at com.google.apphosting.runtime.http.HttpApiHostClient.receivedResponse(HttpApiHostClient.java:296) at com.google.apphosting.runtime.http.JettyHttpApiHostClient$Listener.onComplete(JettyHttpApiHostClient.java:206) at

It seems related to a possible flake in the API server backend, having a race condition between the close statement of the HTTP request and the API request, and when the API is really called, the API ticket is null, and it should not be null.

ludoch commented 1 month ago

Possible code change on java side https://github.com/GoogleCloudPlatform/appengine-java-standard/pull/278 does not seems enough. Looking at C++ server side now.