Commit Graph

8 Commits

Author SHA1 Message Date
Markus Thömmes bebd5557fe Turn websocket's handshake timeout down again. (#941) 2019-12-11 07:02:49 -08:00
JUN JIE NAN 27b3dc39ad Fixed knative activator handshake timeout issue (#836)
The original handshake timeout is too short to dial connection
successfully under some situation. So the activator pod can not be
active. And the log message just say "Failed to send ping message to
ws://autoscaler.knative-serving.svc.cluster.local:8080", not easy to
figure out what's the problem underneeth.

The fix switch to websocket default dial, so the default handle shake
time is 45 seconds, and once dial error found, the error will be
reported as error.
2019-11-18 23:19:07 -08:00
Victor Agababov 8ccafcb6f9 Clean up websocket code a bit. (#753)
* Clean up websocket code a bit.

1. %q are very annoying when actually trying to read logs and the address is obvious.
2. there's no reason to have external error (and we were swallowing the timeout error, should it happen)

* fixes
2019-10-09 09:48:37 -07:00
Kenjiro Nakayama f2b2d2869c Print target name when failed to ping (#632)
* Print target name when failed to ping

For example, when serving activator fails to ping autoscaler, it fails
with `Failed to send ping message` message. However, it does not print
target peer's name so it is difficult to debug.

This patch changes to print the target name.

* Print log without sprintf sugar
2019-09-04 18:05:03 -07:00
Matt Moore fe25685384 Add a way to check the status of the websocket. (#337)
Related to: https://github.com/knative/serving/issues/3508
2019-03-25 08:41:50 -07:00
Markus Thömmes 00226b3943 Add ping message verification to the websocket connection. (#269)
* Add ping message verification to the websocket connection.

* Recycle ticker.

* Add comment.

* Fix datarace by waiting for goroutines to finish on Shutdown.
2019-02-12 09:05:43 -08:00
Markus Thömmes 3df885a8fc Hardening the websocket client. (#262)
* Cleanup websocket connection, actually test reconnects.

* Some more cleanup.

* Locally define connFactory to avoid races.

* Move locks around, harden test.

* Add logging.

* Drop redundant target.

* Move message encoding outside of the writerLock.

* Fix assignment nit.

* Remove named return value.

* Add close signal to long-running loops.

* Add todo for returning a messageType.

* Bump header to 2019.

* Add note on draining the messageChan.

* Drop target from signature.

* Drop target from test.

* Add a more speaking example to draining the messageChan.

* Fix typo.

* Relax read lock, improve test.

* Bump test coverage.

* Add double shutdown test.

* Remove code duplication in test.
2019-02-08 09:51:41 -08:00
Markus Thömmes fff36e41c6 Add durable websocket client from serving. (#206)
* Add durable websocket client from serving.

* Remove accidental bump.

* Finally used the update-deps.sh script for good.
2018-12-20 13:00:36 -08:00