CRM-10766 Log messages for queue processing are unpredictably dropped

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.1
    • Component/s: None
    • Labels:
      None

      Description

      a) The TaskContext includes an instance of PEAR's "Log" class which points to the CiviCRM log file – as provided by CRM_Core_Error::createDebugLog(). The same "Log" instance can be used for multiple writes.
      b) CRM_Core_Error::debug_log_message() calls CRM_Core_Error::createDebugLog() and opens the log, writes to it, and immediately closes it. Thus, each Log instance is used for a single write.

      In some (but not all) use-cases, debug_log_message() fails to write messages to the log. This is most likely due to the differing open/close patterns.

        Attachments

          Issue Links

            Activity

            [CRM-10766] Log messages for queue processing are unpredictably dropped
            Tim Otten added a comment -

            Looking at this again today, I was no longer able to reproduce the situation in the way that I remembered it. Moreover, I ruled out the theory described in this ticket with a unit-test in r42238. I did find an issue in which drush never wrote upgrade errors to the log (fixed in r42239). Given how rapidly I was alternating between different scenarios (various combinations of upgrade medium, output mechanism, and error type), it's possible that my memory mixed up some of the details of the combinations. In any event, I've patched the only issue I could reproduce today.

              People

              • Assignee:
                Tim Otten
                Reporter:
                Tim Otten

                Dates

                • Created:
                  Updated:
                  Resolved: