Matthias Hanel
6a1c3fc29b
Moving inbound tracing to the caller (client.parse)
...
Tracing for outgoing operations is always done while
holding the client lock.
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-04 17:31:18 -05:00
Matthias Hanel
fe373ac597
Incorporating comments.
...
c -> client
defer in oneliner
argument order
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-04 15:48:19 -05:00
Matthias Hanel
f5bd07b36c
[FIXED] trace/debug/sys_log reload will affect existing clients
...
Fixed #1296 , by altering client state on reload
Detect a trace level change on reload and update all clients.
To avoid data races, read client.trace while holding the lock,
pass the value into functionis that trace while not holding the lock.
Delete unused client.debug.
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-04 13:54:15 -05:00
Ivan Kozlovic
34e4c64e50
Merge pull request #1295 from nats-io/sys-trace
...
Adding option to enable tracing the system account. (default: false)
2020-03-02 16:48:55 -07:00
Ivan Kozlovic
fcb6dfe9a7
Merge pull request #1286 from nats-io/error-suggestion
...
Suggestion to improve tracing in nats-server through wrapping errors
2020-03-02 16:44:24 -07:00
Matthias Hanel
9539199b88
Fixed help text and variable naming
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-02 15:09:52 -05:00
Matthias Hanel
6bd6757ca5
Renamed traceSystemAcc to traceSysAcc
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-02 14:32:42 -05:00
Matthias Hanel
5fa9b654ce
changing sys_trace to trace_verbose, adding -VV and -DVV flags
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-02 14:27:58 -05:00
Matthias Hanel
bf952a3807
Adding option to enable tracing the system account. (default: false)
...
Use sys_trace option in config file or --sys_trace on the command line
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-03-01 19:42:40 -05:00
Derek Collison
f8a53a1408
Merge pull request #1293 from nats-io/client_ip
...
Place server's version of client IP in INFO
2020-02-29 13:32:05 -08:00
Derek Collison
087854c9d8
Rename to ClientIP for INFO
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-02-29 13:23:22 -08:00
Derek Collison
d521e1594d
Place server's version of client IP in INFO
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-02-28 18:27:08 -08:00
Ivan Kozlovic
bb432f47e9
Merge pull request #1287 from nats-io/fix_bench_tests
...
Fixed benchmark tests to be able to run with Go 1.13+
2020-02-26 15:18:09 -07:00
Ivan Kozlovic
7ab9c76f2b
Fixed benchmark tests to be able to run with Go 1.13+
...
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-02-26 12:12:18 -07:00
Matthias Hanel
2754968e33
Renaming IsErr to ErrorIs
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-25 19:53:09 -05:00
Matthias Hanel
b6d5906154
Only use errors.Is backwards compatibility code, delete gobackcomp pkg
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-25 19:26:17 -05:00
Matthias Hanel
b57ea29002
Add missing delete from rename
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-25 18:35:11 -05:00
Matthias Hanel
5b8e7c1a41
Deleting dead code
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-25 18:16:50 -05:00
Matthias Hanel
d8297ddf41
Adding a go version compatibility package.
...
Currently enables Errors.Is functionality as ErrorsIs.
Using this functionality in errors.go and unit tests.
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-25 18:08:04 -05:00
Matthias Hanel
c18a5a2582
Fixing typos, copyright date and changed type in log.go/Error func
...
added comment and changed type Error(c,sc)
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-24 19:37:25 -05:00
Matthias Hanel
d1d34d2638
Suggestion to improve tracing in nats-server through wrapping errors
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-24 16:00:46 -05:00
Ivan Kozlovic
62bacf1044
Merge pull request #1283 from nats-io/fix_flappers
...
Fixed flappers
2020-02-19 19:32:29 -07:00
Ivan Kozlovic
37291df206
Fixed yet another flapper
...
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-02-19 17:33:16 -07:00
Ivan Kozlovic
156bf7b381
Updates based on code review
...
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-02-19 16:52:41 -07:00
Ivan Kozlovic
8e4b449119
Fixed flappers
...
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-02-19 13:19:08 -07:00
Ivan Kozlovic
dbb083210a
Merge pull request #1282 from nats-io/ctrl-line-error
...
Use constant for error
2020-02-18 09:07:05 -07:00
Matthias Hanel
329cc7225b
Use constant for error
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-18 10:54:12 -05:00
Ivan Kozlovic
a5b3cf2ead
Merge pull request #1281 from nats-io/config
...
parse ping_interval as duration, else assume seconds and warn
2020-02-17 18:29:17 -07:00
Matthias Hanel
82a275943e
Fix unreliable test
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-17 20:22:52 -05:00
Matthias Hanel
db83b8a55a
Avoid all else and adhere to general style. Adding Flush as requested.
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-17 16:52:13 -05:00
Matthias Hanel
f7a84e3662
Removed unnecessary else
...
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-17 14:03:30 -05: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
Ivan Kozlovic
c22b2c097d
Merge pull request #1276 from nats-io/fix_lame_duck_mode_shutdown
...
[FIXED] Server that is sent the lame duck mode signal does not exit
2020-02-10 18:13:49 -07:00
Ivan Kozlovic
59f99c1233
Merge pull request #1274 from nats-io/config
...
[IMPROVED] Replace panic with error during configuration parsing/reload
2020-02-10 18:05:44 -07:00
Ivan Kozlovic
a6874b2107
[FIXED] Server that is sent the lame duck mode signal does not exit
...
Resolves #1275
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-02-10 17:35:40 -07:00
Matthias Hanel
c7e4d261f4
recover from error during parsing or reload will cause a crash
...
Keep track of the last token used.
When recovering from a panic, create a configErr use that token.
Signed-off-by: Matthias Hanel <mh@synadia.com >
2020-02-10 18:51:12 -05:00
Matthias Hanel
82ebe084c9
recover from error during parsing or reload will cause a crash
...
This will also result in a line number where the issue is
2020-02-07 18:18:22 -05:00
Ivan Kozlovic
c0b97b7a22
Merge pull request #1272 from nats-io/add_resolver_tls
...
[ADDED] Ability to specify TLS configuration for account resolver
2020-02-03 17:17:14 -07:00
Ivan Kozlovic
7208e7f817
[ADDED] Ability to specify TLS configuration for account resolver
...
A new config section allows to specify specific TLS parameters for
the account resolver:
```
resolver_tls {
cert_file: ...
key_file: ...
ca_file: ...
}
```
Resolves #1271
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-02-03 14:35:05 -07:00
Ivan Kozlovic
fb009afa8c
Merge pull request #1267 from nats-io/release_2_1_4
...
Release 2.1.4
v2.1.4
2020-01-30 08:50:54 -07:00
Ivan Kozlovic
2e2f94edea
Release 2.1.4
...
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-01-29 16:35:59 -07:00
Ivan Kozlovic
4798567266
Merge pull request #1265 from nats-io/ensure-leafconn
...
Add check to prevent leafnode connecting to client port
2020-01-29 15:05:20 -07:00
Ivan Kozlovic
27ae160f75
Use CID and LeafNodeURLs as an indicator connected to proper port
...
First, the test should be done only for the initial INFO and only
for solicited connections. Based on the content of INFO coming
from different "listen ports", use the CID and LeafNodeURLs for
the indication that we are connected to the proper port.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-01-29 14:43:41 -07:00
Waldemar Quevedo
ecb5008fe3
Add check prevent leafnode connecting to client port
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2020-01-28 12:43:27 -08:00
Ivan Kozlovic
308037e8ea
Merge pull request #1264 from nats-io/fix_tlssavename
...
[FIXED] Reset of tlsName only for x509.HostnameError
2020-01-28 13:36:09 -07:00
Ivan Kozlovic
47b08335a4
[FIXED] Reset of tlsName only for x509.HostnameError
...
For issue #1256 , we cleared the possibly saved tlsName on Hanshake failure.
However, this meant that for normal use cases, if a reconnect failed for
any reason we would not be able to reconnect if it is an IP until we get
back to the URL that contained the hostname.
We now clear only if the handshake error is of x509.HostnameError type,
which include errors such as:
```
"x509: Common Name is not a valid hostname: <x>"
"x509: cannot validate certificate for <x> because it doesn't contain any IP SANs"
"x509: certificate is not valid for any names, but wanted to match <x>"
"x509: certificate is valid for <x>, not <y>"
```
Applied the same logic to solicited gateway connections, and fixed the fact
that the tlsConfig should be cloned (since we set the ServerName).
I have also made a change for leafnode connections similar to what we are
doing for gateway connections, which is to use the saved tlsName only if
tlsConfig.ServerName is empty, which may not be the case for users that
embed NATS Server and pass directly tls configuration. In other words,
if the option TLSConfig.ServerName is not empty, always use this value.
Relates to #1256
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-01-28 13:16:38 -07:00
Derek Collison
b1fc364a6c
Merge pull request #1261 from nats-io/mixed
...
Fix for #1256
2020-01-22 12:01:38 -08:00
Derek Collison
643e73c0c5
Fix for #1256 , mixed IP and DNS for cluster and TLS with leafnodes
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-01-22 11:25:09 -08:00
Ivan Kozlovic
687571b455
Merge pull request #1260 from nats-io/fix_conn_addr_ipv6
...
[FIXED] Display of connections address when using IPv6
2020-01-22 10:03:17 -07:00
Ivan Kozlovic
20768b72c3
[FIXED] Display of connections address when using IPv6
...
When the server logs information related to a connection, it uses
the connection IP and remote port as a prefix. When it was an IPv6
address, the square brackets would be missing.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com >
2020-01-22 09:12:39 -07:00