Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4966

Debug asserts fail when trying to schedule a continuation from a lifecycle plugin message hook

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 7.1.0
    • Plugins
    • None

    Description

      The plugin message callback for the lifecycle hook is called from a special core thread which is not an EThread. Because of this debug assertions fail in TSContSchedule (and other API calls) because mutex operations fail due to the lack of EThread.

      Attachments

        Issue Links

          Activity

            amc Alan M. Carroll created issue -

            There are two issues here. One is that the thread for the lifecycle callbacks for plugin messages should be an EThread to make this easier. This thread is started as a special case via startProcessManager::start.

            The other issue is why PLUGIN_FORCE_SCOPED_MUTEX locks the mutex. I can see no reason to do that, since the continuation is guaranteed to be called in a different scope and the lock is not required to be held to schedule the continuation.

            amc Alan M. Carroll added a comment - There are two issues here. One is that the thread for the lifecycle callbacks for plugin messages should be an EThread to make this easier. This thread is started as a special case via startProcessManager::start . The other issue is why PLUGIN_FORCE_SCOPED_MUTEX locks the mutex. I can see no reason to do that, since the continuation is guaranteed to be called in a different scope and the lock is not required to be held to schedule the continuation.
            bcall Bryan Call made changes -
            Field Original Value New Value
            Backport to Version 7.0.0 [ 12325951 ]
            Fix Version/s 7.1.0 [ 12337879 ]
            Assignee Alan M. Carroll [ amc ]
            bcall Bryan Call made changes -
            Summary Debug asserts fail when trying to schedule a continuation from a lifecycle plugin message hook. Debug asserts fail when trying to schedule a continuation from a lifecycle plugin message hook
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 16:19
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30581 [ 30581 ]
            Remaining Estimate 0h [ 0 ]
            Time Spent 10m [ 600 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 16:33
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30582 [ 30582 ]
            Time Spent 10m [ 600 ] 20m [ 1200 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 16:34
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30583 [ 30583 ]
            Time Spent 20m [ 1200 ] 0.5h [ 1800 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 16:59
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30587 [ 30587 ]
            Time Spent 0.5h [ 1800 ] 40m [ 2400 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 17:04
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30588 [ 30588 ]
            Time Spent 40m [ 2400 ] 50m [ 3000 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 17:27
            • Time Spent:
              10m
               
              Github user SolidWallOfCode commented on the issue:

                  https://github.com/apache/trafficserver/pull/1103
                
                  Had to fiddle with the call to `ProcessManager::start` due to casting issues with the function type. Rather than deal with that, I reverted to using the lambda which works on all C++ 11 compilers.
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30595 [ 30595 ]
            Time Spent 50m [ 3000 ] 1h [ 3600 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 17:38
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30598 [ 30598 ]
            Time Spent 1h [ 3600 ] 1h 10m [ 4200 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 17:39
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30599 [ 30599 ]
            Time Spent 1h 10m [ 4200 ] 1h 20m [ 4800 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ] This issue links to "GitHub Pull Request #1103 (Web Link)" [ 58616 ]
            githubbot ASF GitHub Bot logged work - 13/Oct/16 19:20
            githubbot ASF GitHub Bot made changes -
            Worklog Id 30609 [ 30609 ]
            Time Spent 1h 20m [ 4800 ] 1.5h [ 5400 ]

            Commit 837d838b096f9ec6d1a663dac136f294c73cda66.

            amc Alan M. Carroll added a comment - Commit 837d838b096f9ec6d1a663dac136f294c73cda66.
            amc Alan M. Carroll made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            bcall Bryan Call added a comment - - edited

            I had problems cherry picking this into the 7.0.x branch (hash 837d838b096f9ec6d1a663dac136f294c73cda66). If you would like to get this into the 7.0.0 release please make a github pull request for the 7.0.x branch.

            bcall Bryan Call added a comment - - edited I had problems cherry picking this into the 7.0.x branch (hash 837d838b096f9ec6d1a663dac136f294c73cda66). If you would like to get this into the 7.0.0 release please make a github pull request for the 7.0.x branch.

            People

              amc Alan M. Carroll
              amc Alan M. Carroll
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h

                  Slack

                    Issue deployment