You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Paul Clare (Created) (JIRA)" <ji...@apache.org> on 2012/03/23 19:11:30 UTC

[jira] [Created] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
------------------------------------------------------------------------

                 Key: VYSPER-304
                 URL: https://issues.apache.org/jira/browse/VYSPER-304
             Project: VYSPER
          Issue Type: Question
          Components: BOSH
    Affects Versions: 0.7
            Reporter: Paul Clare


I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.

So here is what is happening:

Here are the RIDs 318 never made it through.

Last sent response = 316
Highest Read = 317
Current = 319
Window = 319

The coding of 

requestExpired {
  ... ... 

  while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
    write0(boshHandler.getEmptyResponse());
   }

Coupled with 

write0 {
  if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
     delayedResponseQueue.offer(response);

Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.

So in trying to fix this I am having trouble understanding why this would be done in a loop ? 

My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.

Is is not sufficient to write a single empty response when the request expires in the continuation? 

The spec is of very little help here so any thoughts would be greatly appreciated.
  


--
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] [Assigned] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

Posted by "Bernd Fondermann (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VYSPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bernd Fondermann reassigned VYSPER-304:
---------------------------------------

    Assignee: Bernd Fondermann
    
> BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
> ------------------------------------------------------------------------
>
>                 Key: VYSPER-304
>                 URL: https://issues.apache.org/jira/browse/VYSPER-304
>             Project: VYSPER
>          Issue Type: Question
>          Components: BOSH
>    Affects Versions: 0.7
>            Reporter: Paul Clare
>            Assignee: Bernd Fondermann
>              Labels: patch
>
> I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.
> So here is what is happening:
> Here are the RIDs 318 never made it through.
> Last sent response = 316
> Highest Read = 317
> Current = 319
> Window = 319
> The coding of 
> requestExpired {
>   ... ... 
>   while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
>     write0(boshHandler.getEmptyResponse());
>    }
> Coupled with 
> write0 {
>   if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
>      delayedResponseQueue.offer(response);
> Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.
> So in trying to fix this I am having trouble understanding why this would be done in a loop ? 
> My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.
> Is is not sufficient to write a single empty response when the request expires in the continuation? 
> The spec is of very little help here so any thoughts would be greatly appreciated.
>   

--
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] [Assigned] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

Posted by "Bernd Fondermann (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VYSPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bernd Fondermann reassigned VYSPER-304:
---------------------------------------

    Assignee: Bernd Fondermann
    
> BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
> ------------------------------------------------------------------------
>
>                 Key: VYSPER-304
>                 URL: https://issues.apache.org/jira/browse/VYSPER-304
>             Project: VYSPER
>          Issue Type: Question
>          Components: BOSH
>    Affects Versions: 0.7
>            Reporter: Paul Clare
>            Assignee: Bernd Fondermann
>              Labels: patch
>
> I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.
> So here is what is happening:
> Here are the RIDs 318 never made it through.
> Last sent response = 316
> Highest Read = 317
> Current = 319
> Window = 319
> The coding of 
> requestExpired {
>   ... ... 
>   while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
>     write0(boshHandler.getEmptyResponse());
>    }
> Coupled with 
> write0 {
>   if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
>      delayedResponseQueue.offer(response);
> Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.
> So in trying to fix this I am having trouble understanding why this would be done in a loop ? 
> My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.
> Is is not sufficient to write a single empty response when the request expires in the continuation? 
> The spec is of very little help here so any thoughts would be greatly appreciated.
>   

--
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] [Assigned] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

Posted by "Bernd Fondermann (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VYSPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bernd Fondermann reassigned VYSPER-304:
---------------------------------------

    Assignee:     (was: Bernd Fondermann)
    
> BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
> ------------------------------------------------------------------------
>
>                 Key: VYSPER-304
>                 URL: https://issues.apache.org/jira/browse/VYSPER-304
>             Project: VYSPER
>          Issue Type: Question
>          Components: BOSH
>    Affects Versions: 0.7
>            Reporter: Paul Clare
>              Labels: patch
>
> I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.
> So here is what is happening:
> Here are the RIDs 318 never made it through.
> Last sent response = 316
> Highest Read = 317
> Current = 319
> Window = 319
> The coding of 
> requestExpired {
>   ... ... 
>   while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
>     write0(boshHandler.getEmptyResponse());
>    }
> Coupled with 
> write0 {
>   if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
>      delayedResponseQueue.offer(response);
> Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.
> So in trying to fix this I am having trouble understanding why this would be done in a loop ? 
> My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.
> Is is not sufficient to write a single empty response when the request expires in the continuation? 
> The spec is of very little help here so any thoughts would be greatly appreciated.
>   

--
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] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

Posted by "Bernd Fondermann (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240263#comment-13240263 ] 

Bernd Fondermann commented on VYSPER-304:
-----------------------------------------

I understand your concerns. Thanks for reporting.
                
> BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
> ------------------------------------------------------------------------
>
>                 Key: VYSPER-304
>                 URL: https://issues.apache.org/jira/browse/VYSPER-304
>             Project: VYSPER
>          Issue Type: Question
>          Components: BOSH
>    Affects Versions: 0.7
>            Reporter: Paul Clare
>              Labels: patch
>
> I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.
> So here is what is happening:
> Here are the RIDs 318 never made it through.
> Last sent response = 316
> Highest Read = 317
> Current = 319
> Window = 319
> The coding of 
> requestExpired {
>   ... ... 
>   while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
>     write0(boshHandler.getEmptyResponse());
>    }
> Coupled with 
> write0 {
>   if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
>      delayedResponseQueue.offer(response);
> Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.
> So in trying to fix this I am having trouble understanding why this would be done in a loop ? 
> My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.
> Is is not sufficient to write a single empty response when the request expires in the continuation? 
> The spec is of very little help here so any thoughts would be greatly appreciated.
>   

--
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] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259442#comment-13259442 ] 

Bernd Fondermann commented on VYSPER-304:
-----------------------------------------

Should now be fixed. Empty responses are now handled differently in write0() aka writeBoshResponse()
                
> BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
> ------------------------------------------------------------------------
>
>                 Key: VYSPER-304
>                 URL: https://issues.apache.org/jira/browse/VYSPER-304
>             Project: VYSPER
>          Issue Type: Question
>          Components: BOSH
>    Affects Versions: 0.7
>            Reporter: Paul Clare
>            Assignee: Bernd Fondermann
>              Labels: patch
>
> I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.
> So here is what is happening:
> Here are the RIDs 318 never made it through.
> Last sent response = 316
> Highest Read = 317
> Current = 319
> Window = 319
> The coding of 
> requestExpired {
>   ... ... 
>   while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
>     write0(boshHandler.getEmptyResponse());
>    }
> Coupled with 
> write0 {
>   if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
>      delayedResponseQueue.offer(response);
> Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.
> So in trying to fix this I am having trouble understanding why this would be done in a loop ? 
> My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.
> Is is not sufficient to write a single empty response when the request expires in the continuation? 
> The spec is of very little help here so any thoughts would be greatly appreciated.
>   

--
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] [Resolved] (VYSPER-304) BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

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

Bernd Fondermann resolved VYSPER-304.
-------------------------------------

    Resolution: Fixed
    
> BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue
> ------------------------------------------------------------------------
>
>                 Key: VYSPER-304
>                 URL: https://issues.apache.org/jira/browse/VYSPER-304
>             Project: VYSPER
>          Issue Type: Question
>          Components: BOSH
>    Affects Versions: 0.7
>            Reporter: Paul Clare
>            Assignee: Bernd Fondermann
>              Labels: patch
>
> I have been struggling with an issue where more than occasionally the delayedResponseQueue will be filled with empty responses until the server eventually runs out of memory. The client is JSJac but I am not really focused on that implementation, I just want to try and protect the server from being over run by any client.
> So here is what is happening:
> Here are the RIDs 318 never made it through.
> Last sent response = 316
> Highest Read = 317
> Current = 319
> Window = 319
> The coding of 
> requestExpired {
>   ... ... 
>   while(!requestsWindow.isEmpty() && requestsWindow.firstKey() <= req.getRid()) {
>     write0(boshHandler.getEmptyResponse());
>    }
> Coupled with 
> write0 {
>   if (requestsWindow.isEmpty() || requestsWindow.firstKey() > highestReadRid) {
>      delayedResponseQueue.offer(response);
> Can easily lead to an infinite loop writing empty response to the delayedResponseQueue.
> So in trying to fix this I am having trouble understanding why this would be done in a loop ? 
> My first instinct is to change the while loop to an if statement but I assume there is a good reason it was implemented this way, I just cannot see it.
> Is is not sufficient to write a single empty response when the request expires in the continuation? 
> The spec is of very little help here so any thoughts would be greatly appreciated.
>   

--
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