Websocket + PING

John Arbash Meinel john.meinel at canonical.com
Sun Jun 30 09:54:03 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I was looking over the golang websocket implementation that we are
using, and it appears that it doesn't really support them.

Specifically, it supports the minimum from here:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#section-5.5.2

That if you get a Ping you should return a Pong with the content from
the Ping.

However, the very next line in the code is:
	case PongFrame:
		return nil, ErrNotImplemented

Which means that while if it ever got a Ping it will Pong, it has no
way to actually handle a Pong. And I cannot find any code for
initiating a Ping (which makes sense, since it would be unable to
handle the response anyway.)

So I'm pretty sure that if we want a reasonable 'is this agent still
alive' we should implement our own heartbeat running in the agent,
rather than having the heartbeat running in the API server and
trusting the websocket connection to notice that the server is missing.

It is something that we could possibly punt on for now (sockets
themselves do notice when the channel goes dead, though that can be
arbitrarily long after the remote end actually goes away).

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlHQADsACgkQJdeBCYSNAAM0swCeKu+rSw8xfjX7LQM2LYt9QG+x
044AoKa3qq/Tp6bmtow1RjNm7RzrX8L2
=maxa
-----END PGP SIGNATURE-----



More information about the Juju-dev mailing list