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

Access to variables scope in onSessionStart() is not thread safe

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.5.2.017
    • Fix Version/s: 5.2.9.12
    • Labels:
      None
    • Sprint:
      July 2018 Sprint

      Description

      If I use the following Application.cfc (with an empty index.cfm file):

      component {
      
          this.name = 'testApp';
          this.sessionManagement = true;
      
          variables.templateId = createUuid();
      
          function onSessionStart() {
              request.templateId = variables.templateId;
          }
      
          function onRequestStart( string targetPage ) {
              writeOutput( "variables.templateId: " & variables.templateId );
              writeOutput( chr(10) );
              writeOutput( "request.templateId: " & request.templateId );
          }
      
      }
      

      and hit it with a number of simultaneous new session requests, there will always be at least one request where variables.templateId does not match request.templateId. Instead the outputted request.templateId will match the variables.templateId of one of the other requests.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              jberquist John Berquist
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: