Commit Graph

46 Commits

Author SHA1 Message Date
Ivan Kozlovic
3c9a7cc6e5 Move to Go 1.19, remote io/util, fix data race and a flapper
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-05 09:55:37 -06:00
Derek Collison
146d8f5dcb Updates based on feedback, sped up some slow tests
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-12 17:26:43 -07:00
Derek Collison
2bd7553c71 System Account on by default.
Most of the changes are to turn it off for tests that were watching subscriptions and such.

Signed-off-by: Derek Collison <derek@nats.io>
2020-05-29 17:56:45 -07:00
Derek Collison
7cb6056a94 Account support for Connz and user or account filtering
1. Accounts will show up in connection info if auth=1.
2. You can filter by user (?auth=1&user=ivan) or account (?auth=1&acc=eng)

Signed-off-by: Derek Collison <derek@nats.io>
2019-10-11 10:22:08 -07:00
Ivan Kozlovic
ed1901c792 Update go.mod to satisfy v2 requirements
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-03 19:45:47 -06:00
Derek Collison
d7140a0fd1 Update for client rename
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-10 15:11:30 -07:00
Derek Collison
acfe372d63 Changes for rename from gnatsd -> nats-server
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:04:24 -07:00
Derek Collison
3b953ce838 Allow localhost to not be defined, only need 127.0.0.1
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 16:10:19 -07:00
Derek Collison
7e28af236b Support for RTT - #643
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-20 20:18:59 -07:00
Derek Collison
df574ce951 varz cluster empty when not defined
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
766ef3b0b1 Add max_pending and write_deadline to varz
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic
1acf330e07 [ADDED] Notification to clients when servers leave the cluster
Until now, a server would only notify clients of servers that join
the cluster. More than that, a server would send ot its clients only
information if new servers were added.
This PR changes this by sending to clients that support async INFO
the list of URLs for all servers in the cluster any time that there
is a change (joining or leaving the cluster).
As of now, clients will not be affected by the change (and will not
take benefit of this: removing servers from their server pool). This
will be addressed in each supported client once this is merged.
2018-02-27 14:22:13 -07:00
Ivan Kozlovic
22cff99e58 [Fixed] Profiling and Monitoring timeout issues
The http servers for those two were recently modified to set
a ReadTimeout and WriteTimeout. The WriteTimeout specifically
caused issues for Profiling since it is common to ask sampling
of several seconds. Pprof code would reject the request if it
detected that http server's WriteTimeout was more than sampling
in request.
For monitoring, any situation that would cause the monitoring code
to take more than 2 seconds to gather information (could be due
to locking, amount of objects to return, time required for sorting,
etc..) would also cause cURL to return empty response or WebBrowser
to fail to display the page.

Resolves #600
2017-11-08 14:58:10 -07:00
Ivan Kozlovic
773b25af85 [FIXED] Shutdown stops http server when started manually
In case one creates a server instance with New() and then starts
the http server manually (s.StartHTTPMonitoring()), calling
s.Shutdown() would not stop the http server because Shutdown()
would return without doing anything if `running` was not true.
This boolean was set to true only in `s.Start()`.

Also added StartMonitoring() to perform the options check and
selectively start http or https server to replace individual calls.
This is useful for NATS Streaming server that will now be able
to call s.StartMonitoring() without having to duplicate code
about options checks and http server code.

This is related to PR #481
2017-05-25 17:01:35 -06:00
Ivan Kozlovic
513c0a0971 [FIXED] Specifying HTTP and HTTPs ports produces unexpected behavior
The server will now print a Fatal error if user tries to configure
both HTTP and HTTPs ports.

Resolves #495
2017-05-24 13:06:04 -06:00
Colin Sullivan
efbd423e96 Updates based on comments. 2017-03-01 20:46:47 -07:00
Colin Sullivan
3f8a0d8b4a Use atomic.Load to access fields used in /varz and /subsz requests.
* Includes a unit test that checks all endpoints for data races.
2017-03-01 16:13:20 -07:00
Derek Collison
61e0b758d7 Updates for Go client rename, update vendor dependencies 2016-11-20 13:15:37 -08:00
Ivan Kozlovic
645529243f Fix staticcheck reported issues
The tool is started with the "-ignore" flag to ignore warning SA2002
which corresponds to invoking t.Fatalf (and the like) in a go routine.
Calling t.Fatalf in a go routine may produce a race condition.
The rationale for ignoring this warning is that if a test executes
the t.Fatalf() line it is that we have a problem either with test
or code that should be fixed.
2016-11-15 12:54:36 -07:00
Ivan Kozlovic
2bec28e146 Fix test
Loop should stop whenever a valid ip is found.
2016-05-23 20:05:09 -06:00
Derek Collison
82f04baa12 Allow optional reporting of authorized user under connz 2016-05-15 10:07:37 -07:00
Derek Collison
9e73c1db76 Enable listen address parsing for client, cluster and http, enforce http hosts as separate 2016-05-12 16:47:01 -07:00
Colin Sullivan
8a07a02a97 Rename the field to 'total'. 2016-04-26 17:49:09 -06:00
Colin Sullivan
a6dfe88746 Add a live connection count to /connz monitoring. 2016-04-26 17:24:01 -06:00
Colin Sullivan
2baac47820 Address issues found by golint.
* No functional changes
* Did not address the ALL_CAPS issues
* Did not modify public APIs and field names.
2016-03-15 15:21:13 -06:00
Waldemar Quevedo
7ac3eae82e Set IP and Port for connections using TLS in /connz 2016-02-15 17:40:13 -08:00
Ivan Kozlovic
b6292d6d6d Fix monitor port usage for parallel tests.
Use a different MONITOR_PORT for different test packages.
2016-02-08 09:33:39 -07:00
Derek Collison
cb47c2e494 fixup for collapsed struct 2015-08-06 01:01:29 -07:00
Derek Collison
96bab33075 fixed import paths 2015-06-19 12:08:11 -07:00
Derek Collison
082a43f7ae Additional testing for monitoring 2015-06-16 10:31:15 -07:00
Derek Collison
aabc9a2a7c add in client lang and version reporting, bump limit 2015-06-15 20:58:59 -07:00
Máximo Cuadros Ortiz
d85225e56b fixing http test, disabling keepalive 2014-10-06 22:11:13 +02:00
Máximo Cuadros Ortiz
502ba2e43e connz: limit and offset 2014-10-04 22:39:09 +02:00
Máximo Cuadros Ortiz
3cde0eef60 added subsz and connz extended, and merged with varz 2014-10-04 22:38:59 +02:00
Máximo Cuadros Ortiz
9afb590cf9 improved connz with subscriptions stats and list of subscriptions by client 2014-10-04 22:38:59 +02:00
Derek Collison
9dc875b88e pedantic about over zealous GC for sockets 2014-09-18 21:25:13 -07:00
Derek Collison
71c0c28ced copyright hygiene 2013-10-16 13:40:15 -07:00
Derek Collison
d21e2caf8c golint updates 2013-10-13 09:52:51 -07:00
Derek Collison
4e1502cc4c README license, copyright cleanup, etc 2013-09-30 10:16:43 -07:00
Derek Collison
6ab5d6a337 Fixed msg payload accounting, made http monitoring work in Go routines 2013-08-19 15:09:41 -07:00
Derek Collison
cf0f30200f log file support, data race fixes 2013-08-02 16:52:54 -07:00
Derek Collison
5a3688e3b0 Updated varz tests, added connection details 2013-01-22 10:45:27 -08:00
Derek Collison
6b2e2e82d8 Revert for travis version of Go 2013-01-22 10:00:38 -08:00
Derek Collison
fd1f6faa59 Added on /connz endpoint for monitoring 2013-01-22 09:35:46 -08:00
Derek Collison
3977043780 Added first pass http monitoring (e.g. /varz) 2013-01-02 18:11:01 -06:00