private static List getRuntimeFlags()

in runtime/main/src/main/java/com/google/apphosting/runtime/JavaRuntimeMainWithDefaults.java [69:174]


  private static List<String> getRuntimeFlags() {
    // Can't use Guava here, as the main class has minimal deps in order to have a small class
    // loader.
    String jettyPort = System.getenv().getOrDefault(PORT_ENV_VARIABLE_NAME, "8080");
    boolean disableNGinx = "true".equals(System.getenv(GAE_DISABLE_NGINX));
    if (disableNGinx) {
      // Having Jetty listening to default nginx port will disable nginx.
      jettyPort = "8080";
    }

    // By convention, inherited from the managed vm work, when running locally, we should define
    // the GAE_PARTION variable to "dev"... This is used in the runtime image common /serve.
    // In local mode, the API server should be configured on localhost:$LOCAL_API_PORT
    // In prod, the API server is hardcoded to appengine.googleapis.internal:10001
    boolean executionIsLocal = "dev".equals(System.getenv(GAE_PARTITION_ENV_VARIABLE_NAME));
    String trustedPort =
        executionIsLocal
            ? System.getenv().getOrDefault(API_HOSTPORT_ENV_VARIABLE_NAME, "localhost:8089")
            : "appengine.googleapis.internal:10001";
    return Arrays.asList(
        "--api_call_deadline=10",
        "--api_call_deadline_map=app_config_service:60.0,"
            + "blobstore:15.0,"
            + "datastore_v3:60.0,"
            + "datastore_v4:60.0,file:30.0,"
            + "images:30.0,"
            + "logservice:60.0,"
            + "mail:30.0,"
            + "modules:60.0,"
            + "rdbms:60.0,"
            + "remote_socket:60.0,"
            + "search:10.0,"
            + "stubby:10.0",
        "--appengine_release_name=mainwithdefaults",
        "--application_root=notused",
        "--cycles_per_second=1000000000",
        "--default_to_builtin_url_stream_handler=true",
        "--default_use_google_connectorj=true",
        "--enable_gae_cloud_sql_jdbc_connectivity=true",
        "--enable_synchronized_app_logs_writer=true",
        "--external_datacenter_name=MARS",
        // This flag must be given in this Main.
        // "--fixed_application_path=" + ...,
        "--force_readahead_on_cloudsql_socket=true",
        "--interrupt_threads_first_on_soft_deadline=true",
        "--java_hard_deadline_ms=10200",
        "--java_soft_deadline_ms=10600",
        "--jetty_http_port=" + jettyPort,
        "--jetty_request_header_size=262144",
        "--jetty_response_header_size=262144",
        "--mail_filename_prevents_inlining=true",
        "--mail_support_extended_attachment_encodings=true",
        "--max_api_call_deadline_map=app_config_service:60.0,"
            + "blobstore:30.0,"
            + "datastore_v3:270.0,"
            + "datastore_v4:270.0,"
            + "file:60.0,"
            + "images:30.0,"
            + "logservice:60.0,"
            + "mail:60.0,"
            + "modules:60.0,"
            + "rdbms:60.0,"
            + "remote_socket:60.0,"
            + "search:60.0,"
            + "stubby:60.0,"
            + "taskqueue:30.0,"
            + "urlfetch:60.0",
        "--max_offline_api_call_deadline=10",
        "--max_offline_api_call_deadline_map=app_config_service:60.0,"
            + "blobstore:30.0,"
            + "datastore_v3:270.0,"
            + "datastore_v4:270.0,"
            + "file:60.0,"
            + "images:30.0,"
            + "logservice:60.0,"
            + "mail:60.0,"
            + "modules:60.0,rdbms:600.0,"
            + "remote_socket:60.0,"
            + "search:60.0,"
            + "stubby:600.0,"
            + "taskqueue:30.0,"
            + "urlfetch:600.0",
        "--offline_api_call_deadline=5",
        "--offline_api_call_deadline_map=app_config_service:60.0,"
            + "blobstore:15.0,"
            + "datastore_v3:60.0,"
            + "datastore_v4:60.0,"
            + "file:30.0,"
            + "images:30.0,"
            + "logservice:60.0,"
            + "mail:30.0,"
            + "modules:60.0,"
            + "rdbms:60.0,"
            + "remote_socket:60.0,"
            + "search:10.0,"
            + "stubby:10.0",
        // port is only used for the Java grpc server plugin in the Java8 gen 1, but needed.
        "--port=0",
        "--runtime_http_compression=true",
        "--trusted_host=" + trustedPort,
        "--use_clone_controller_for_deadlines=true",
        "--use_env_vars_from_app_info=true",
        "--use_jetty_http_proxy=true",
        "--wait_for_daemon_request_threads=false",
        "--log_json_to_var_log=true");
  }