We are developing a Web server with tomcat. We have a requirement that if the disk is about to full (a threshold about 500MB left), we will respond to the file upload request with error code 503 server unavailable.
The question is we don't want to read this request body (file upload) at all, so we just respond to the client with error code without reading the request body. But in this case, we will get an "connection reset" issue, since client is still send the request but we (the server) close the connection.
So is there a way that servlet/tomcat do not need read the request body and just send a response code?