Commit Graph

31 Commits

Author SHA1 Message Date
Dave Protasowski ee1db869c7
Update linter config and address lint warnings/failures (#3068)
* fix whitespace linter

* fix usestdlibvars

* fix staticheck

* ignore spancheck warning

* fix linter perfsprint

* fix nolintlint feedback

* fix nilerr lint checks

* fix misspell

* fix mirror lint

* fix intrange linter

* fix gofumpt linter

* fix gosec linter - ignore warning since default min tls version is 1.3

* fix gocritic linter

* fix whitespace

* fix fatcontext linter

* fix errorlint

* fix errname linter

* fix copyloopvar (go1.22) linter

* fix bodyclose linter

* update linter config

* add script to format code

* fix unit test
2024-06-25 14:49:36 +00:00
Dave Protasowski 8535fcc248
gofumpt the repo (#3067)
* gofumpt the repo

* don't prefix numbers with 0 - otherwise they're octal
2024-06-25 07:27:07 +00:00
Prashant Rewar fef5da99bd
Replace all usages of deprecated wait.PollImmediate with wait.PollUntilContextTimeout (#3004)
Signed-off-by: Prashant Rewar <108176843+prashantrewar@users.noreply.github.com>
2024-04-02 14:44:03 +00:00
Dave Protasowski 8532ae0645
update OWNERS files to use teams with active members (#2672)
* update OWNERS files to use teams with active members

* add eventing-wg leads as approvers to /apis
2023-02-06 16:58:45 +00:00
Dave Protasowski 3d24b8416b
fix lint warnings (#2589)
* resolve deprecation warnings

* drop use of ioutil

* fix license

* run hack/update-codegen.sh
2022-09-12 18:15:45 +00:00
Evan Anderson 728bc4ad4e
Update OWNERS_ALIASES to match autogen in community (#2078) 2021-04-08 07:42:51 -07:00
Markus Thömmes 261c9b4624
Remove unnecessary intermediate loggers (#1969)
* Remove unnecessary intermediate loggers

* Make linter happy

* Collapse logging variable into if contexts
2020-12-16 08:27:58 -08:00
Victor Agababov c5296cd61e
Log body as well, since it's useful, it seems (#1926) 2020-11-24 11:42:35 -08:00
Victor Agababov 49e55c9eb8
Provide the information about why did the connection fail (#1924)
All the juicy details are in that http response,
the error is basically meaningless
2020-11-23 18:31:35 -08:00
Markus Thömmes 565516e224
Add errorlint and fix all existing issues (#1855) 2020-10-29 01:14:35 -07:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07:00
Yanwei Guo 7f9b02e2c0
Add a func to return a connection which has been established (#1729)
* add sync func

* add comment

* Update websocket/connection.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* reviews

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-09-22 11:03:40 -07:00
Yanwei Guo 72aa424f98
expose (#1684) 2020-09-03 20:19:31 -07:00
Markus Thömmes e9da10bc8a
Make test override pongTimeout correctly. (#1665)
* Make test override pongTimeout correctly.

* Reset pong timeout after test.
2020-08-31 02:46:08 -07:00
Victor Agababov 34838c4559
Remove all ClearAll calls from pkg UTs (#1654)
We need this in order to deprecate the function.
Serving is already free of those.
2020-08-27 13:13:07 -07:00
Julian Friedman 0c198ddb92
Add SendRaw to websocket client (#1396)
allows using non-gob encodings over the socket
2020-06-09 06:59:32 -07:00
Victor Agababov 66f1d63f10
Fix logging around pkg (#1310)
- use more performant functions (mostly remove formatters were possible)
- move zap.Error() to the call site, rather than creating a new sugared logger with a key attached (not cheap)
- fix *w usages where the key was not provided.
2020-05-07 15:00:45 -07:00
Markus Thömmes 1b903ad8cc
Fix malformed license headers. (#1258) 2020-04-29 08:38:42 -07:00
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 9c320664c8 Add OWNERS to the websocket which was missing before. (#754)
* Add OWNERS to the websocket which was missing before.

Alias it to the controller approvers which seem more or less reasonable

* review
2019-10-09 11:32:13 -07: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
Victor Agababov 74c5d67ea0 Fix the issues pointed out by staticcheck (#541)
* Fix the issues pointed out by staticcheck

* review fix
2019-07-23 13:13:36 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Matt Moore 35a6f90d16 Sprinkle more ClearAll around to enabled -count=N (#485) 2019-06-23 19:24:02 -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
Nghia Tran 717a172c91 Helper to call Hijack on a http.ResponseWriter if possible. (#281) 2019-02-15 13:13:44 -08: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