Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1820

[ruby] Container#schedule does not work if called from handler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-c-0.22.0
    • proton-c-0.23.0
    • ruby-binding
    • None

    Description

      The Container#schedule method does not work if called from a handler function.

       

      WORKAROUND: The following monkey-patch can be used to work-around the bug until the fix is released

       

      require 'qpid_proton'
      
      # Monkey-patch to fix https://issues.apache.org/jira/browse/PROTON-1820 in proton 0.22
      # The patch will not be needed with proton >= 0.23
      module Qpid::Proton
      
        module ContainerFix
          def run_one(task, now)
            if task == :schedule
              @lock.synchronize { @active -= 1; check_stop_lh } if maybe_panic { @schedule.process now }
              @lock.synchronize { @schedule_working = false }
              wake
            else
              super
            end
          end
        end
      
        class Container
          prepend ContainerFix
        end
      end
      

      Attachments

        Activity

          People

            aconway Alan Conway
            aconway Alan Conway
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: