set connection timeout in java for MPS client

3 vues (au cours des 30 derniers jours)
Jason Novotny
Jason Novotny le 6 Jan 2022
Hi,
Based on Java documentation in MPS guide, I configured a 5 minute connection timeout as below:
However, I have a long running Matlab function on MPS and it times out after just 1 minute and not 5...
I get the error:
! com.mathworks.mps.client.MWHttpException: Failed HTTP request; Response Status: 504, Response Message: Gateway Time-out
! at com.mathworks.mps.client.internal.SunHttpClientFevalHandler.processRequest(Unknown Source)
! at com.mathworks.mps.client.internal.ComponentProxy.processRequest(Unknown Source)
! at com.mathworks.mps.client.internal.ComponentProxy.invoke(Unknown Source)
! at com.mathworks.mps.client.internal.SingleOutputDispatcher.dispatch(Unknown Source)
! at com.mathworks.mps.client.internal.MWClientInvocationHandler.invoke(Unknown Source)
! at com.sun.proxy.$Proxy75.CompareModels(Unknown Source)
What am I doing wrong?
static class MyClientConfig extends MWHttpClientDefaultConfig {
public long getTimeOutMs() {
log.info("MPS timeout set to 5 minutes");
return 5*6*1000; // 5 minutes
}
}
MWHttpClient client = new MWHttpClient(new MyClientConfig());

Réponses (2)

Kojiro Saito
Kojiro Saito le 7 Jan 2022
5*6*1000 is 30000 milliseconds (=30 seconds). Are you sure you set 5*60*1000 ?
public long getTimeOutMs() {
log.info("MPS timeout set to 5 minutes");
return 5*60*1000; // 5 minutes
}

Jason Novotny
Jason Novotny le 7 Jan 2022
The issue resulted from the Elastic Load Balancer configuration in AWS which has a default of 60 seconds.

Catégories

En savoir plus sur Installation dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by