Bug 9960 - Comet does not always send /meta/subscribe
: Comet does not always send /meta/subscribe
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Controller
: unspecified
: PC Windows XP
: -- blocker (vote)
: 7.x
Assigned To: Richard Titmuss
:
Depends on:
Blocks: 9958
  Show dependency treegraph
 
Reported: 2008-11-11 08:46 UTC by Richard Titmuss
Modified: 2009-07-31 10:31 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Titmuss 2008-11-11 08:46:09 UTC
I have debugged this on Jive, not on the SC side. But this is what I see:

Jive sends the connect and subscriptions to SC:

{ --[[table: 0xb8e758]]
  { --[[table: 0x939200]]
    clientId = "55560X74052c556a3741a58e69b3382e2c7914X1226419121Xd4d07ee5",
    connectionType = "streaming",
    channel = "/meta/connect",
  },
  { --[[table: 0x7982a8]]
    clientId = "55560X74052c556a3741a58e69b3382e2c7914X1226419121Xd4d07ee5",
    subscription = "/55560X74052c556a3741a58e69b3382e2c7914X1226419121Xd4d07ee5/**",
    channel = "/meta/subscribe",
  },
  { --[[table: 0xb026c0]]
    id = 1,
    data = { --[[table: 0x8ee118]]
      request = { --[[table: 0xb02670]]
        "",
        { --[[table: 0x7e1c10]]
          "serverstatus",
          0,
          50,
          "subscribe:60",
        },
      },
      response = "/55560X74052c556a3741a58e69b3382e2c7914X1226419121Xd4d07ee5/slim/serverstatus",
    },
    channel = "/slim/subscribe",
  },
}

SC only responds with the serverstatus, the /meta/connect response is missing:

003738:13459 WARN (Comet.lua:780) - Comet {harrypotter} chunk in:
003738:13462 WARN (Comet.lua:784) - ############## /4913019d/slim/serverstatus

The debug above is added at the top of _response:

_response = function(self, chunk)
        -- If we have data
        if not chunk then
                return
        end

+log:warn(self, " chunk in:")
+for i, event in ipairs(chunk) do
+   log:warn("############## ", event.channel)
+end
+
        -- Process each response event
        for i, event in ipairs(chunk) do

This is re-creatable on jive and the desktop squeezeplay. It causes problems with some of the later subscriptions, as the comet state is not correctly updated (to connected). Also it causes jive to do multiple connections to SC, and will slow down the initial connect time.
Comment 1 Andy Grundman 2008-11-11 16:20:24 UTC
OK, it looks like the server sends these responses out of order from the original request.  The serverstatus comes first, followed by the /meta/connect and /meta/subscribe, and /slim/subscribe ack messages.

Is that what you're seeing, or do they not arrive at all?
Comment 2 Andy Grundman 2008-11-11 16:26:59 UTC
I think the right solution is for Jive to split this into 2 packets:

/meta/connect and /meta/subscribe
/slim/subscribe

Fixing it in SC is more complicated because you don't always want to send the results of a /slim/subscribe back on the same connection the request was sent in on.
Comment 3 Richard Titmuss 2008-11-12 08:55:09 UTC
Fixed in r3346. Squeezeplay now only sends the subscriptions after the /meta/(re)connect response.

Comment 4 James Richardson 2008-12-15 12:09:31 UTC
This bug has been fixed in the 7.3.0 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 5 Chris Owens 2009-07-31 10:31:43 UTC
Reduce number of active targets for SC