Uploaded image for project: 'VYSPER'
  1. VYSPER
  2. VYSPER-304

BoshBackendSessionContext: Infinite Loop writing to DelayedResponseQueue

    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.7
    • None
    • BOSH

    Description

      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.

      Attachments

        Activity

          People

            brainlounge Bernd Fondermann
            pclare Paul Clare
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: