簡體   English   中英

請求中的 GAE 錯誤代碼 104 中斷了所有並發請求

[英]GAE Error code 104 in request breaks all concurrent request

我們遇到以下錯誤模式:

  1. API 調用 urlfetch.Fetch() 被取消,因為已達到總體 HTTP 請求截止日期。 嵌套異常為 java.io.IOException: com.google.apphosting.api.ApiProxy$CancelledException: API 調用 urlfetch.Fetch() 已取消,因為已達到總體 HTTP 請求截止日期。

2.除了

com.google.apphosting.api.ApiProxy$CancelledException:API 調用 urlfetch.Fetch() 被取消,因為線程在等待並發 API 調用時被中斷。 嵌套異常是 java.io.IOException: com.google.apphosting.api.ApiProxy$CancelledException: The API call urlfetch.Fetch() 被取消,因為線程在等待並發 API 調用時被中斷

3.在接下來的幾毫秒內進入 GAE 應用程序的后續請求失敗,並顯示相同的Error code 104

RestTemplate restTemplate = new RestTemplate(getClientHttpRequestFactory());

try {           
    URI uri = new URI("https://sample/" + sessionId);           
    sessionInfo = restTemplate.getForObject(uri, SessionResponse.class);        } catch (Exception e) {             
     System.out.println(e.getMessage());        
}

我將 restTemplate 的超時設置為 50 秒,此代碼位於攔截器中,每個請求都將遷移到此代碼塊並執行

我正在使用javax.servlet.Filter來遷移請求,我遇到了第二個異常

對此的任何解決方案將不勝感激,謝謝

Appengine-web.xml 文件

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <threadsafe>true</threadsafe>
    <runtime>java8</runtime>
    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
    </system-properties>
    <url-stream-handler>urlfetch</url-stream-handler>
    <warmup-requests-enabled>false</warmup-requests-enabled>
</appengine-web-app>

App Engine 中的錯誤代碼104通常意味着您的實例面臨 OOM 問題或超過 Deadline 異常。

正如我從你的評論中了解到的,第二個問題發生了。 解決這個問題的一個選項是將您的縮放類型設置為basic-scaling 在基本縮放的情況下,您的應用只有在 24 小時內沒有回復響應時才會超時。

您可以在此處閱讀更多相關信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM