2

We are trying to diagnose a timeout issue, by trying to set the server.connection-timeout in application.yml

To explore solutions, we first try to cause a connection timeout. The idea is to set the timeout to 10s and cause a timeout in a GSP page. However, we find that we are unable to cause the server timeout, by modifying the index.gsp and adding a Thread.sleep(20000).

Replication instructions:

  • Create a grails appliction from grails forge:

    curl -O start.grails.org/timeout.zip -d version=3.3.10 -d features=events,geb,hibernate5,json-views
    
  • Modify application.yml

    server:
        connection-timeout: 10000
    
  • Add a sleep loop in index.jsp

    <%
        Thread.sleep(20000)
    %>
    
  • load up the default page of the application upon startup

Notes:

  • By debugging the Tomcat lifecycle, I can see that the embedded servlet container is assigned the 10000ms configuration during initialization.
  • If I change the sleep loop to 65s, I still don't get a timeout. Most of the documentation mentions that the default value is the 60s)
Puneet Behl
  • 954
  • 7
  • 20
Luis Muñiz
  • 4,649
  • 1
  • 27
  • 43

0 Answers0