105 Commits

Author SHA1 Message Date
Jaime Piña
220c8785fc Declare required JetStream resources in test
Currently, tests that use js-op.conf use dynamic JetStream limits,
calculated from the machine where the test is run. However, this file
also has an account JWT that requires an explicit amount of resources.
This causes some tests to pass on some machine, but not others.

This change explicitly declares the max storage and memory limits
JetStream requires to match the limits specified in the account JWT, so
that the host environment doesn't influence the tests.
2021-04-16 15:21:35 -07:00
Jaime Piña
e44275b963 Consolidate temporary test files and directories
Currently, temporary test files and directories are written in lots of
different paths within the OS's temp dir. This makes it hard to know
which files are from nats-server and which are unrelated. This in turn
makes it hard to clean up nats-server test files.
2021-04-06 10:42:55 -07:00
Derek Collison
61771e88f8 In operator mode with JetStream we want to load accounts that have stable storage.
Also if an account was registered but not JetStream enabled, update it vs error.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 06:53:13 -07:00
Derek Collison
dd61535e5a Cluster names are now required.
Added cluster names as required for prep work for clustered JetStream. System can dynamically pick a cluster name and settle on one even in large clusters.

Signed-off-by: Derek Collison <derek@nats.io>
2020-06-12 15:48:38 -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
Guilherme Santos
25858cba0b Implement basePath for monitoring endpoints 2020-05-13 23:29:11 +02:00
Matthias Hanel
3fbf8cac2e parse ping_interval as duration, else assume seconds and warn
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-17 12:59:34 -05:00
Derek Collison
daabd4dfde Merge pull request #1158 from ripienaar/1153.hostname
Allows a descriptive server_name to be set
2019-10-17 10:31:41 -07:00
R.I.Pienaar
bcf96fa1de Allows a descriptive server_name to be set
This adds a new config option server_name that
when set will be exposed in varz, events and more
as a descriptive name for the server.

If unset though the server_name will default to the pk

Signed-off-by: R.I.Pienaar <rip@devco.net>
2019-10-17 18:51:19 +02:00
Derek Collison
35758ef7d4 Update the test CA and certs.
Expiration is now Oct 14 14:30:41 2029 GMT

Signed-off-by: Derek Collison <derek@nats.io>
2019-10-17 07:33:08 -07:00
Jaime Piña
176a19de75 Update SYS account name
Currently, the $SYSTEM subject is used in this repo, but it seems like this
subject name is out of date.

This change updates the code to use $SYS to match the documentation.
2019-09-04 13:49:59 -05:00
Waldemar Quevedo
5c776d4363 Fix typo
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-08-13 19:59:28 -07:00
Derek Collison
8f5bc503e5 Add ability for cross account import services to return streams as well as singeltons.
Take into account tracking of response maps that are created and do proper cleanup.
Also fixes #1089 which was discovered while working on this.

Signed-off-by: Derek Collison <derek@nats.io>
2019-08-06 14:15:40 -07:00
Derek Collison
495a1a7ec3 Allow dynamic publish permissions based on reply subjects of received msgs
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-25 13:17:26 -07:00
Ivan Kozlovic
d2578f9e05 Update to connect/reconnect error reports logic
Changed the introduced new option and added a new one. The idea
is to be able to differentiate between never connected and reconnected
event. The never connected situation will be logged at first attempt
and every hour (by default, configurable).
However, once connected and if trying to reconnect, will report every
attempts by default, but this is configurable too.

These two options are supported for config reload.

Related to #1000
Related to #1001
Resolves #969

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-26 17:51:01 -06:00
Ivan Kozlovic
7272e4e317 Make the error report attempts configurable
This is a continuation of #1000. Added a configuration to specify
the number of attempts at which the repeated error is reported.
The algo is now to print only the 1st attempt and when current
attempt % <this config param> == 0.

Resolves #969

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-20 16:28:48 -06: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
Ivan Kozlovic
e1a4cbaf70 Update to LameDuck mode
- Increase grace period to 10sec
- Make default 2min
- Reject config with value less than 30sec
- Don't wait more than 1sec between clients if there are much
  less than alloted time
- Stop after last one (was still sleeping after last client was
  closed)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-11-28 18:04:26 -07:00
Ivan Kozlovic
086b26f14a Gateways: Ignore reference to self
Allows the use of a global include for all gateways and each
gateway will ignore its own reference.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-11-28 14:24:28 -07:00
Derek Collison
b2ec5b3a98 Added more tests, e.g. reload
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-06 19:58:42 -08:00
Ivan Kozlovic
0067c3bb04 Added support for lame duck mode
When receiving SIGUSR2 signal (or -sl ldm) the server stops
accepting new clients, closes routes connections and spread the
closing of client connections based on a config lame duck duration
(default is 30sec). This will help preventing a storm of client
reconnect when a server needs to be shutdown.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-10-19 19:07:37 -06:00
Waldemar Quevedo
e819f15ca4 Collecting all config errors then flush before exit
Show warnings on server startup

Removes notions around `pedantic` checks and instead
just reports the warnings in case there were any, or
the collection of errors that may have been found
in the configuration file.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-10-16 13:29:29 -07:00
Waldemar Quevedo
181b07ebc1 Config reporting with line and error position
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-10-02 11:38:15 -07:00
Derek Collison
9f8330bcc9 Added import and export parsing for configs
Signed-off-by: Derek Collison <derek@nats.io>
2018-09-29 13:04:19 +02:00
Waldemar Quevedo
df2364af26 Add -t pedantic config check to the server
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-09-11 16:06:53 -07:00
Ivan Kozlovic
c5203dc763 Update some tests
- Config reload tests have been modified to not rely on symlink.
- Close logger on shutdown (for Windows tests cleanup)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-09-05 10:45:09 -06:00
Derek Collison
65188f9768 Added parser for new style authorizations
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-22 20:41:48 -07:00
Derek Collison
e78d587083 Added support for maximum subscriptions per connection
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-01 15:13:59 -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
719deacc3d Fixes #686
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 13:14:18 -07:00
Derek Collison
37352edff0 Fixes #681
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-19 16:42:39 -07:00
Derek Collison
844f376140 Performance optimizations, beta3, fixes to various tests.
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-11 15:11:03 -07:00
Derek Collison
50a99241ea Slow consumer updates and latency improvements.
Use pending bytes as slow consumer trigger, so reintroduce max_pending.
Improve latency with inplace flush calls when appropriate. Utilize simple
time budget for readLoop routine.

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
Colin Sullivan
f7368bf903 Add config files 2018-03-13 15:38:52 -06:00
Ivan Kozlovic
1fa136b21a Improved Config Reload test coverage
- Move the kill of a server in a cluster test to ensure that
  list of routes to remove is not empty.
- Change write_deadline reload value to 3s to make it different
  from default value
- Add test for option that does not support hot-swapping
2017-07-19 11:59:05 -06:00
Ivan Kozlovic
edc1d74c0c Use loopback for some config reload tests 2017-07-11 11:38:32 -06:00
Tyler Treat
dea34307f1 Merge branch 'master' of github.com:nats-io/gnatsd into fix_comment 2017-07-10 19:00:49 -05:00
Ivan Kozlovic
cae6b0b23a Some fixes
Use include so that we can have logfile and remote sys log tested
on platforms other than Windows.
Added some missing defer server.Shutdown() statements.
2017-07-10 16:33:19 -06:00
Tyler Treat
317a04f106 Fix error in test comment
The test is ensuring config reload fails when trying to change cluster
host.
2017-07-10 12:32:12 -05:00
Tyler Treat
ca1b3485cb Fix "error opening file" errors in tests for Windows
This sort of just punts on the problem by not creating log files in the
tests, but it seemed like the simplest solution.
2017-07-10 12:21:01 -05:00
Tyler Treat
901a5c7122 Address CR feedback 2017-06-28 11:05:02 -05:00
Tyler Treat
88c864b2af Add reload support for ping interval, max pings, and write deadline 2017-06-22 17:01:56 -05:00
Tyler Treat
5501e288a8 Support syslog config reload 2017-06-22 16:33:33 -05:00
Tyler Treat
b898b5561a Add reload support for pid_file, max_control_line, and max_payload 2017-06-22 14:48:40 -05:00
Tyler Treat
11c2720e0e Add support for reloading max_connections 2017-06-22 12:59:54 -05:00
Tyler Treat
8f5aa0433d Add support for reloading logtime and log_file 2017-06-22 12:59:13 -05:00
Tyler Treat
f98e327b74 Fix test config 2017-06-19 15:02:02 -05:00
Tyler Treat
2ea1afd82d Add clustering to config reload tests 2017-06-19 14:40:57 -05:00
Tyler Treat
182f5ce53b Add tests around cluster reload 2017-06-19 14:18:29 -05:00