8000 don't use `UrlFetchTransport` in App Engine Flex environment · Issue #1492 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

don't use UrlFetchTransport in App Engine Flex environment #1492

@eddavisson

Description

@eddavisson

The decision of whether to use UrlFetchTransport instead of NetHttpTransport is currently based on the presence of the com.google.appengine.application.id system property. This can result in UrlFetchTranport being used in the App Engine Flex environment (at least in compat mode).

One possible approach is:

if (System.getProperty("com.google.appengine.application.id") != null
    // Rule out App Engine Flex compat mode.
    && System.getenv("GAE_VM") == null
    // Rule out App Engine Flex.
    && System.getenv("GCLOUD_PROJECT" ) == null) {
  // use UrlFetchTransport
}

https://github.com/GoogleCloudPlatform/google-cloud-java/blob/e5f90467fe7490759482e6a8bc62b1246318a7f0/google-cloud-core/src/main/java/com/google/cloud/HttpServiceOptions.java#L61

https://github.com/GoogleCloudPlatform/google-cloud-java/blob/0d9d1b3ce548aa5335e23b8c2ec0464df8002d9f/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java#L318

Metadata

Metadata

Assignees

Labels

api: coreapi: datastoreIssues related to the Datastore API.running on app enginetype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0