1

I have a Javalin server, the relevant code called by the endpoint looks like this:

...
if(!someFuture.isDone()){
    ctx.status(102);
    return;
}

Javalin hangs and does not return anything* when the HTTP status is set to anything in the 1XX range. 2XX, 3XX and 4XX are returned without any problems. I haven't been able to find anything in Javalin's documentation about this, but are 1XX status codes not allowed by Javalin? If not, why is 102 causing this problem?

*eventually Postman registers a socket hang up

Dan
  • 12,157
  • 12
  • 50
  • 84
  • 1
    Please [edit] your question to include your source code as a working [mcve], which can be compiled and tested by others. – Progman Dec 26 '22 at 10:52

1 Answers1

5

The meaning of the 1XX range is:

The server has received the request and is continuing the process

So when you respond with it, the client will await data.

From the documentation (Javalin builded on Jetty):

102 Processing RFC 2518 defined the 102 Processing status code that can be sent:

when the server has a reasonable expectation that the request will take significant time to complete. As guidance, if a method is taking longer than 20 seconds (a reasonable, but arbitrary value) to process the server SHOULD return a 102 Processing response. — RFC 2518 section 10.1 However, a later update of RFC 2518, RFC 4918, removed the 102 Processing status code for "lack of implementation".

Jetty supports the 102 Processing status code. If a request is received with the Expect: 102-processing header, then a filter/servlet may send a 102 Processing response (without terminating further processing) by calling response.sendError(102).

blacktide
  • 10,654
  • 8
  • 33
  • 53
utrucceh
  • 1,076
  • 6
  • 11