[jira] Created: (STOMP-20) @reliable connections will infinite loop when max_reconnect_attempts are reached

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (STOMP-20) @reliable connections will infinite loop when max_reconnect_attempts are reached

JIRA jira@codehaus.org
@reliable connections will infinite loop when max_reconnect_attempts are reached
--------------------------------------------------------------------------------

                 Key: STOMP-20
                 URL: http://jira.codehaus.org/browse/STOMP-20
             Project: Stomp
          Issue Type: Bug
            Reporter: Ricardo Ramalho


Scenario:
1. Stomp connection is created with reliable=true (default when hash parameters are passed), and max_reconnect_attempts>0
2. Connection suceeds
3. Bus goes down
4. socket method (connection.rb) will retry connection, up to max_reconnect_attempts
5. Stomp::Error::MaxReconnectAttempts is raised when max_reconnect_attempts
6. transmit (the calling method) will catch every exception, including Stomp::Error::MaxReconnectAttempts
7. Since transmit is a while true, the library will infinite loop (with no sleep) until the bus is up

Recommend transmit lets Stomp::Error::MaxReconnectAttempts go through, so that the calling program can handle it. After all, it specified a number of max_reconnect_attempts

def transmit(command, headers = {}, body = '')
        # The transmit may fail so we may need to retry.
        while TRUE
          begin
            used_socket = socket
            _transmit(used_socket, command, headers, body)
            return
          rescue Stomp::Error::MaxReconnectAttempts => e
            raise
          rescue
            @failure = $!
            raise unless @reliable
            $stderr.print "transmit to #{@host} failed: #{$!}\n"
          end
        end
      end


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (STOMP-20) @reliable connections will infinite loop when max_reconnect_attempts are reached

JIRA jira@codehaus.org

    [ http://jira.codehaus.org/browse/STOMP-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=263763#action_263763 ]

Guy Allard commented on STOMP-20:
---------------------------------

Ricardo - I suggest that you open this issue at:  https://github.com/morellon/stomp/issues.

It looks like a good idea to me.

Regards, Guy


> @reliable connections will infinite loop when max_reconnect_attempts are reached
> --------------------------------------------------------------------------------
>
>                 Key: STOMP-20
>                 URL: http://jira.codehaus.org/browse/STOMP-20
>             Project: Stomp
>          Issue Type: Bug
>            Reporter: Ricardo Ramalho
>
> Scenario:
> 1. Stomp connection is created with reliable=true (default when hash parameters are passed), and max_reconnect_attempts>0
> 2. Connection suceeds
> 3. Bus goes down
> 4. socket method (connection.rb) will retry connection, up to max_reconnect_attempts
> 5. Stomp::Error::MaxReconnectAttempts is raised when max_reconnect_attempts
> 6. transmit (the calling method) will catch every exception, including Stomp::Error::MaxReconnectAttempts
> 7. Since transmit is a while true, the library will infinite loop (with no sleep) until the bus is up
> Recommend transmit lets Stomp::Error::MaxReconnectAttempts go through, so that the calling program can handle it. After all, it specified a number of max_reconnect_attempts
> def transmit(command, headers = {}, body = '')
>         # The transmit may fail so we may need to retry.
>         while TRUE
>           begin
>             used_socket = socket
>             _transmit(used_socket, command, headers, body)
>             return
>           rescue Stomp::Error::MaxReconnectAttempts => e
>             raise
>           rescue
>             @failure = $!
>             raise unless @reliable
>             $stderr.print "transmit to #{@host} failed: #{$!}\n"
>           end
>         end
>       end

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email