Hi In my rest API, everytime time my request generates an OutOfMemoryError the client doesn't get a response from server and hangs forever. If I kill the client, I can see by lsof that a CLOSE_WAIT connection remains and it goes away just if I restart the Spring application. I can reproduce it easily with an plain Servlet:
public class CustomServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { System.out.println("Test"); throw new OutOfMemoryError(); } } Any request to this servlet hangs, if the client gives up a CLOSE_WAIT connection remains. I'd like to know if there is some way to get over it and if it is a bug. Tomcat 9.0.11 SO: 4.4.0-21-generic #37-Ubuntu SMP x86_64 GNU/Linux Tomcat embedded in spring-boot-starter-web of spring-boot 2.0.4.RELEASE JDK: 1.8.0_121 65 bits Thanks