You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "Darryl L. Pierce (JIRA)" <ji...@apache.org> on 2012/08/14 16:26:38 UTC

[jira] [Created] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Darryl L. Pierce created PROTON-1:
-------------------------------------

             Summary: Provides %contract assurances in the swig layer for language bindings.
                 Key: PROTON-1
                 URL: https://issues.apache.org/jira/browse/PROTON-1
             Project: Qpid Proton
          Issue Type: Bug
            Reporter: Darryl L. Pierce


This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Darryl L. Pierce" <dp...@redhat.com>.
On Thu, Aug 16, 2012 at 01:08:38AM +1100, Rafael H. Schloming (JIRA) wrote:
> Ok, going over this one with a less congested head, I've noticed an issue. The %contract stuff is great for making exceptions occur, but at least for things like checking return error codes it seems to swallow the actual reason for the exception, e.g.:
> 
>     File "/home/rhs/bin/proton-test", line 331, in run
>       phase()
>     File "/home/rhs/proton/tests/proton_tests/messenger.py", line 93, in testSendBogus
>       pn_messenger_put(self.client, msg)
>   RuntimeError: Contract violation: ensure: (result==0)
> 
> 
> I think this is a problem given that things like, pn_messenger_send returns an error code which indicates what has actually gone wrong, and there is a big difference between say a PN_TIMEOUT (indicates that send has blocked for longer than the timeout set for the messenger, not necessarily an error per/se), and PN_STATE_ERR, (indicates the messenger is in some kind of illegal state).

Talking this over in IRC, Rafe and I agree that the contracts are likely
a little over-zealous in handling error conditions. So I'm going to
rework the patch to not raise exceptions on error response codes.

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


[jira] [Resolved] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Rafael H. Schloming (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafael H. Schloming resolved PROTON-1.
--------------------------------------

    Resolution: Fixed
      Assignee: Rafael H. Schloming
    
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>            Assignee: Rafael H. Schloming
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch, cproton.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Rafael H. Schloming (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435143#comment-13435143 ] 

Rafael H. Schloming commented on PROTON-1:
------------------------------------------

Added an updated patch that includes some additional contracts.
                
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch, cproton.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Rafael H. Schloming (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434525#comment-13434525 ] 

Rafael H. Schloming commented on PROTON-1:
------------------------------------------

I've applied this patch and made a few changes in my local checkout. I want to review this when my head is less congested though so I'll probably wait till tomorrow to commit.
                
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Darryl L. Pierce (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Darryl L. Pierce updated PROTON-1:
----------------------------------

    Attachment: 0001-Provides-contract-guarantees-to-language-bindings.patch
    
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Rafael H. Schloming (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafael H. Schloming updated PROTON-1:
-------------------------------------

    Attachment: cproton.patch
    
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch, cproton.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Rafael H. Schloming (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435131#comment-13435131 ] 

Rafael H. Schloming commented on PROTON-1:
------------------------------------------

Ok, going over this one with a less congested head, I've noticed an issue. The %contract stuff is great for making exceptions occur, but at least for things like checking return error codes it seems to swallow the actual reason for the exception, e.g.:

    File "/home/rhs/bin/proton-test", line 331, in run
      phase()
    File "/home/rhs/proton/tests/proton_tests/messenger.py", line 93, in testSendBogus
      pn_messenger_put(self.client, msg)
  RuntimeError: Contract violation: ensure: (result==0)


I think this is a problem given that things like, pn_messenger_send returns an error code which indicates what has actually gone wrong, and there is a big difference between say a PN_TIMEOUT (indicates that send has blocked for longer than the timeout set for the messenger, not necessarily an error per/se), and PN_STATE_ERR, (indicates the messenger is in some kind of illegal state).
                
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Darryl L. Pierce (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Darryl L. Pierce updated PROTON-1:
----------------------------------

    Attachment:     (was: 0001-Provides-contract-guarantees-to-language-bindings.patch)
    
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: cproton.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Darryl L. Pierce (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Darryl L. Pierce updated PROTON-1:
----------------------------------

    Attachment: 0001-Provides-contract-guarantees-to-language-bindings.patch
    
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Darryl L. Pierce
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch, cproton.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PROTON-1) Provides %contract assurances in the swig layer for language bindings.

Posted by "Rafael H. Schloming (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PROTON-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafael H. Schloming updated PROTON-1:
-------------------------------------

    Component/s: proton-c
    
> Provides %contract assurances in the swig layer for language bindings.
> ----------------------------------------------------------------------
>
>                 Key: PROTON-1
>                 URL: https://issues.apache.org/jira/browse/PROTON-1
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>            Reporter: Darryl L. Pierce
>            Assignee: Rafael H. Schloming
>         Attachments: 0001-Provides-contract-guarantees-to-language-bindings.patch, cproton.patch
>
>
> This patch provides %contract assurances for the Proton APIs, defining the pre- and post-conditions for the APIs. For any language binding, when such a condition is not met then a runtime exception is raised.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira