ProxyToys
  1. ProxyToys
  2. PTOYS-5

DelegatingInvoker raises false Cyclic dependency exception

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      2

      Description

      DelegatingInvoker raises a false Cyclic dependency exception if after an execption occured in the delegate.

      A trivial fix is to wrap the invokation of the delegate with a try-finally block resetting the "executing" flag.

      1. DelegatingInvoker.patch
        3 kB
        Scott T Weaver
      2. DelegatingTest.patch
        2 kB
        Scott T Weaver

        Activity

        Hide
        Jörg Schaible added a comment -

        Can you provide also a unit test? There might be more to consider, than just eliminating the check.

        Show
        Jörg Schaible added a comment - Can you provide also a unit test? There might be more to consider, than just eliminating the check.
        Hide
        Scott T Weaver added a comment -

        This fixes a two-fold issue with DelegatingInvoker.
        1. Adds a try/finally to make sure the executing flag is switched off no matter what happens during method invocation.
        2. changed the excuting flag to a Set that locks execution on a per-method basis instead of per-instance basis.

        Show
        Scott T Weaver added a comment - This fixes a two-fold issue with DelegatingInvoker. 1. Adds a try/finally to make sure the executing flag is switched off no matter what happens during method invocation. 2. changed the excuting flag to a Set that locks execution on a per-method basis instead of per-instance basis.
        Scott T Weaver made changes -
        Field Original Value New Value
        Attachment DelegatingInvoker.patch [ 12472 ]
        Hide
        Scott T Weaver added a comment -

        Modification to DelegatingTest to test changes

        Show
        Scott T Weaver added a comment - Modification to DelegatingTest to test changes
        Scott T Weaver made changes -
        Attachment DelegatingTest.patch [ 12473 ]
        Hide
        Dan North added a comment -

        Hi Scott.

        Can you attach the patched files please? I can't get these patches to work (I get a runtime error under win32 and an error that patch #3 doesn't match under linux).

        Thanks,
        Dan

        Show
        Dan North added a comment - Hi Scott. Can you attach the patched files please? I can't get these patches to work (I get a runtime error under win32 and an error that patch #3 doesn't match under linux). Thanks, Dan
        Hide
        Scott T Weaver added a comment -

        I am sure that the patches I posted way back in July are far to old to apply correctly to the current CVS head. I am not sure I still have the proxytoys code box anymore. I will see if there is a way I can easily regen the patches but I can't promise anything.

        Show
        Scott T Weaver added a comment - I am sure that the patches I posted way back in July are far to old to apply correctly to the current CVS head. I am not sure I still have the proxytoys code box anymore. I will see if there is a way I can easily regen the patches but I can't promise anything.
        Hide
        Jörg Schaible added a comment -

        Fixed this now. But why do we check for cycles at all? If I have a method that is calling itself ... fine, e.g. I could calculate a Fibonacci number. If we remove the check, we can avoid the expensive ThreadLocal and set altogether. WDYT?

        Show
        Jörg Schaible added a comment - Fixed this now. But why do we check for cycles at all? If I have a method that is calling itself ... fine, e.g. I could calculate a Fibonacci number. If we remove the check, we can avoid the expensive ThreadLocal and set altogether. WDYT?
        Hide
        Jörg Schaible added a comment -

        Finally fixed with PTOYS-8. Cannot close this issue though due to JIRA rights.

        Show
        Jörg Schaible added a comment - Finally fixed with PTOYS-8 . Cannot close this issue though due to JIRA rights.
        Jörg Schaible made changes -
        Fix Version/s 0.2 [ 11692 ]
        Resolution Fixed [ 1 ]
        Assignee Joerg Schaible [ joehni ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Philipp Meier
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: