Uploaded image for project: 'Lucee Development'
  1. LDEV-1193

Empty response when cfthread used in certain setups

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s: 5.0.1.35
    • Fix Version/s: 5.1.2.10
    • Labels:
      None
    • Sprint:
      February 2017 Release

      Description

      Changes made to fix LDEV-947 Deployed are producing a strange looking behaviour in Lucee 5 running on Commandbox in combination with tuckey urlrewrite filters.

      This can be reproduced using commandbox by creating the following two files in your webroot:
      index.cfm

      <cflog file="debug" text="before the thread"/>
      
      <cfthread name="#CreateUUId()#">
          <cflog file="debug" text="inside the thread" />
      </cfthread>
      
      <h1>Test</h1>
      
      <cflog file="debug" text="after the thread" />
      

      and urlrewrite.xml:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
      <urlrewrite>
          <rule>
              <note>
                  All request ending in / will be rewritten to /index.cfm
              </note>
              <from>^.*?\/$</from>
              <to last="true">/index.cfm</to>
          </rule>
      </urlrewrite>
      

      Then start a box server from the webroot with:

      box start cfengine=lucee@5 rewritesEnable=true rewritesConfig=./urlrewrite.xml
      

      If reproduced, you will see an empty response in the browser but examining debug.log will show that all the code is run. If you remove the call to cfthread, a response is shown in the browser.

      I have tracked this down to this diff: https://github.com/lucee/Lucee/commit/e4dc9b9e0693cef9aa6f6ae7bf3a1d1e906c655c

      In particular, the two HashMap's that were changed to ConcurrentHashMap in the disconnect() method. Recompiling Lucee with these two variables reverted to HashMap makes the problem disappear.

      Clearly I have no idea why that is, so would be great to get some thoughts from core team on this

      Detailed request output

      To illustrate the situation more clearly, here are two CURL requests. The first request is one that is problematic. The second request is one that works without problems.

      curl -D - http://127.0.0.1:38576/
      HTTP/1.1 200 OK
      Connection: keep-alive
      Set-Cookie: cfid=b7fc32fb-34f0-4162-bc82-710d5ee96d69;Path=/;Expires=Sun, 05-Mar-2017 19:31:31 GMT;HTTPOnly
      Set-Cookie: cftoken=0;Path=/;Expires=Sun, 05-Mar-2017 19:31:31 GMT;HTTPOnly
      Set-Cookie: JSESSIONID=lheDnIkw-gl93L_uzd_PGz87C2oDi-Ief8JDPfnD; path=/
      Transfer-Encoding: chunked
      Content-Type: text/html;charset=UTF-8
      Date: Mon, 13 Feb 2017 17:53:27 GMT
      

      and the working one...

      HTTP/1.1 200 OK
      Connection: keep-alive
      Set-Cookie: cfid=d87186eb-a8a2-4068-a17c-278ee5078be2;Path=/;Expires=Sun, 05-Mar-2017 19:32:39 GMT;HTTPOnly
      Set-Cookie: cftoken=0;Path=/;Expires=Sun, 05-Mar-2017 19:32:39 GMT;HTTPOnly
      Set-Cookie: JSESSIONID=itVLyvRFBj9lUFEWKatP24fstyoW_pwkUIJInQDE; path=/
      Content-Type: text/html;charset=UTF-8
      Content-Length: 19
      Date: Mon, 13 Feb 2017 17:54:35 GMT
      
      
      
      
      
      <h1>Test</h1>
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                michaeloffner Michael Offner
                Reporter:
                dom_watson dom_watson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: