You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by "Russell Haering (JIRA)" <ji...@apache.org> on 2010/07/21 00:54:49 UTC

[libcloud] [jira] Created: (LIBCLOUD-44) Workaround GoGrid API Errors

Workaround GoGrid API Errors
----------------------------

                 Key: LIBCLOUD-44
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-44
             Project: Libcloud
          Issue Type: Bug
          Components: Core
            Reporter: Russell Haering


I've been receiving occasional errors from the Mashery Proxy in front of the GoGrid API. I have modified the GoGrid driver to do the following:

1. Use POSTs in place of GETs for API calls with the potential to provision, destroy or reboot servers. These aren't actually used in the fix I eventually settled on, but should probably be used in any case.

2. When checking for the success of a request, check for headers indicating a proxy error and raise an exception specific to this error.

3. Implement a counter to retry requests up to 20 times, once every 10 seconds, when these errors occur. I haven't spent too much time tuning this, but with 10 retries I was still getting occasional failures.

I'll be attaching the patch momentarily, or these changes (among others) have been applied to my github fork at: http://github.com/russellhaering/libcloud

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[libcloud] [jira] Assigned: (LIBCLOUD-44) Workaround GoGrid API Errors

Posted by "Roman Bogorodskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Bogorodskiy reassigned LIBCLOUD-44:
-----------------------------------------

    Assignee: Roman Bogorodskiy

> Workaround GoGrid API Errors
> ----------------------------
>
>                 Key: LIBCLOUD-44
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-44
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Russell Haering
>            Assignee: Roman Bogorodskiy
>         Attachments: gogrid_workaround.patch
>
>
> I've been receiving occasional errors from the Mashery Proxy in front of the GoGrid API. I have modified the GoGrid driver to do the following:
> 1. Use POSTs in place of GETs for API calls with the potential to provision, destroy or reboot servers. These aren't actually used in the fix I eventually settled on, but should probably be used in any case.
> 2. When checking for the success of a request, check for headers indicating a proxy error and raise an exception specific to this error.
> 3. Implement a counter to retry requests up to 20 times, once every 10 seconds, when these errors occur. I haven't spent too much time tuning this, but with 10 retries I was still getting occasional failures.
> I'll be attaching the patch momentarily, or these changes (among others) have been applied to my github fork at: http://github.com/russellhaering/libcloud

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[libcloud] [jira] Updated: (LIBCLOUD-44) Workaround GoGrid API Errors

Posted by "Russell Haering (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Russell Haering updated LIBCLOUD-44:
------------------------------------

    Attachment: gogrid_workaround.patch

> Workaround GoGrid API Errors
> ----------------------------
>
>                 Key: LIBCLOUD-44
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-44
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Russell Haering
>         Attachments: gogrid_workaround.patch
>
>
> I've been receiving occasional errors from the Mashery Proxy in front of the GoGrid API. I have modified the GoGrid driver to do the following:
> 1. Use POSTs in place of GETs for API calls with the potential to provision, destroy or reboot servers. These aren't actually used in the fix I eventually settled on, but should probably be used in any case.
> 2. When checking for the success of a request, check for headers indicating a proxy error and raise an exception specific to this error.
> 3. Implement a counter to retry requests up to 20 times, once every 10 seconds, when these errors occur. I haven't spent too much time tuning this, but with 10 retries I was still getting occasional failures.
> I'll be attaching the patch momentarily, or these changes (among others) have been applied to my github fork at: http://github.com/russellhaering/libcloud

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[libcloud] [jira] Commented: (LIBCLOUD-44) Workaround GoGrid API Errors

Posted by "Roman Bogorodskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891965#action_12891965 ] 

Roman Bogorodskiy commented on LIBCLOUD-44:
-------------------------------------------

Hello Russell,

1. What's the benefit of using POST instead of GET? I've checked the gogrid wiki and it says that both GET and POST are equally supported but I don't see much difference...

2. As I've pointed on IRC, I don't quite like making client code make assumptions on API service configuration (like that they're using Mashery for example). I think it would be better just to create a general exception if the response is not of expected type, lile xml while we expect json, that seems to be a more general solution, what do you thing?

3. I believe such counter should be introduced on the library level, not on a driver level and should be somehow controlled by the user of the library.

BTW, looks like Mashrey issue was fixed, at least things were working fine during Thursday and Friday.

> Workaround GoGrid API Errors
> ----------------------------
>
>                 Key: LIBCLOUD-44
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-44
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Russell Haering
>            Assignee: Roman Bogorodskiy
>         Attachments: gogrid_workaround.patch
>
>
> I've been receiving occasional errors from the Mashery Proxy in front of the GoGrid API. I have modified the GoGrid driver to do the following:
> 1. Use POSTs in place of GETs for API calls with the potential to provision, destroy or reboot servers. These aren't actually used in the fix I eventually settled on, but should probably be used in any case.
> 2. When checking for the success of a request, check for headers indicating a proxy error and raise an exception specific to this error.
> 3. Implement a counter to retry requests up to 20 times, once every 10 seconds, when these errors occur. I haven't spent too much time tuning this, but with 10 retries I was still getting occasional failures.
> I'll be attaching the patch momentarily, or these changes (among others) have been applied to my github fork at: http://github.com/russellhaering/libcloud

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[libcloud] [jira] Closed: (LIBCLOUD-44) Workaround GoGrid API Errors

Posted by "Jed Smith (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jed Smith closed LIBCLOUD-44.
-----------------------------

    Fix Version/s: 0.4.0
       Resolution: Fixed

Roman committed this in r982594, so I am closing this issue. Thanks for the patch.

In r999522 the GoGrid API was upgraded, so this issue might or might not need attention.

> Workaround GoGrid API Errors
> ----------------------------
>
>                 Key: LIBCLOUD-44
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-44
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Russell Haering
>            Assignee: Roman Bogorodskiy
>             Fix For: 0.4.0
>
>         Attachments: gogrid_workaround.patch
>
>
> I've been receiving occasional errors from the Mashery Proxy in front of the GoGrid API. I have modified the GoGrid driver to do the following:
> 1. Use POSTs in place of GETs for API calls with the potential to provision, destroy or reboot servers. These aren't actually used in the fix I eventually settled on, but should probably be used in any case.
> 2. When checking for the success of a request, check for headers indicating a proxy error and raise an exception specific to this error.
> 3. Implement a counter to retry requests up to 20 times, once every 10 seconds, when these errors occur. I haven't spent too much time tuning this, but with 10 retries I was still getting occasional failures.
> I'll be attaching the patch momentarily, or these changes (among others) have been applied to my github fork at: http://github.com/russellhaering/libcloud

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[libcloud] [jira] Commented: (LIBCLOUD-44) Workaround GoGrid API Errors

Posted by "Russell Haering (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892158#action_12892158 ] 

Russell Haering commented on LIBCLOUD-44:
-----------------------------------------

Roman,

1. My final commit didn't make use of the POSTs, so it might make more sense to put them in a separate commit. As to why POST should be used, GET is for retrieving data and by convention (and specification) shouldn't be used for "Unsafe" methods.

2. I'm generally inclined to agree with you on this point. My intention was to abstract away API-specific details, and since I was able to catch and handle this very specific error I decided to do so. Ideally GoGrid would just fix the problem (I haven't tested it in the last few days, but I hope you're right on that), and occasional problems in any API could be passed up to the user, but in this case there should be some distinction between failures on methods that can be safely re-attempted and those that can't (that was my original plan with the POSTs).

3. Definitely

> Workaround GoGrid API Errors
> ----------------------------
>
>                 Key: LIBCLOUD-44
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-44
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Russell Haering
>            Assignee: Roman Bogorodskiy
>         Attachments: gogrid_workaround.patch
>
>
> I've been receiving occasional errors from the Mashery Proxy in front of the GoGrid API. I have modified the GoGrid driver to do the following:
> 1. Use POSTs in place of GETs for API calls with the potential to provision, destroy or reboot servers. These aren't actually used in the fix I eventually settled on, but should probably be used in any case.
> 2. When checking for the success of a request, check for headers indicating a proxy error and raise an exception specific to this error.
> 3. Implement a counter to retry requests up to 20 times, once every 10 seconds, when these errors occur. I haven't spent too much time tuning this, but with 10 retries I was still getting occasional failures.
> I'll be attaching the patch momentarily, or these changes (among others) have been applied to my github fork at: http://github.com/russellhaering/libcloud

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.