58 | | * If the party could not be launched (eg, not enough resources) the server returns error code 503 "Service Unavailable". The 503 includes a message like {{{retry later at 1556631286760}}}. The message is kept human readable but the last element of the message must be a unix timestamp (milliseconds since 1970) containing the time at which to retry. To create this message, the server can either create a default (e.g. let the client retry after a fixed set time) or actually use the estimated termination times of the parties. The current available server does the latter. |
| 58 | * If the party could not be launched (eg, not enough resources) the server returns error code 503 "Service Unavailable". The 503 including a message like {{{retry later at 1556631286760}}}. The message is kept human readable but the last element of the message must be a unix timestamp (milliseconds since 1970) containing the time at which to retry. To create this message, the server can either create a default (e.g. let the client retry after a fixed set time) or actually use the estimated termination times of the parties. The current available server does the latter. |
| 59 | |
| 60 | The "retry later" message must contain the text "retry later" and have the number as the last element of the returned string. The message must be sent as plain text and must be in the normal response channel (not the error channel). The reason is that in Tomcat, placing messages through the error channel result in a html-formatted response object that we can't decypher anymore automatically. The only way to get around that is to use the normal channel and set the error code manually. In a tomcat HttpServlet, this goes like this: |
| 61 | |
| 62 | {{{ |
| 63 | response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); |
| 64 | response.getWriter().append("retry later at " + time); |
| 65 | }}} |