Commit Graph

3539 Commits

Author SHA1 Message Date
Ivan Kozlovic
e321df198f Merge pull request #1804 from nats-io/fix_import_cycle_detection
Fixed service import cycle detection that broke with JS clustering
2021-01-14 11:56:40 -07:00
Ivan Kozlovic
6c4229300a Fixed service import cycle detection that broke with JS clustering
Also added some no-op error handler for some tests to silence the
error report in the log.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-14 11:27:36 -07:00
Derek Collison
a07b5cd1f1 Merge pull request #1803 from nats-io/jsc
JetStream Clustering
2021-01-14 08:32:12 -07:00
Derek Collison
1b0e740123 Fix for race
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 07:28:14 -08:00
Derek Collison
491b3c34cd Tweak timing more for tests
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 07:07:04 -08:00
Derek Collison
9d9f0f7099 Fix for race on setting term
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 07:02:20 -08:00
Derek Collison
14e3319ba3 Fix for no raft node
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 06:59:36 -08:00
Derek Collison
ab2a645791 Fix for various flappers
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 06:54:08 -08:00
Derek Collison
b68d7066c4 Remove alpha banner
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 06:05:55 -08:00
Derek Collison
4bfe9d4c24 Fixes to PR.
Add nats to default storage directory
Fix race in raft, change leader notice
Fix test crash on failure

Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 05:56:05 -08:00
Derek Collison
37cf7584bd Merge branch 'master' into jsc 2021-01-14 02:52:35 -07:00
Derek Collison
f0cdf89c61 JetStream Clustering WIP
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 01:14:52 -08:00
Matthias Hanel
9c2bf8e4a9 [Added] support for jwt export response threshold
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-14 01:12:35 -08:00
Ivan Kozlovic
c4b2c62e58 Merge pull request #1802 from nats-io/fix_sublist_notification
Fixed sublist notification
2021-01-13 22:32:28 -07:00
Ivan Kozlovic
23f8e3d5b9 Fixed sublist notification
The insert notification was done based on the creation of a node
during an insert, which was wrong since the node may have already
existed and still the subscription could be all new. For instance,
suppose that there is a subscription on "foo.bar".
We register an notification interest for "foo", which does not
notify, which is normal. Then we create a subscription on "foo".
During the insert, "foo" node already exists so notification would
not be sent, but it should.
Fixed also removed by having removeFromNode() returning a boolean
to indicate if the subscription was the last in that node.
However, it seems that we again check for interest in
chkForRemoveNotification(), so not sure if that is required.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-13 20:59:36 -07:00
Ivan Kozlovic
25ea8973e8 Merge pull request #1801 from nats-io/fix_1786
Propose going back to condition variable to notify writeLoop
2021-01-13 08:06:17 -07:00
Ivan Kozlovic
7b116379cb Propose going back to condition variable to notify writeLoop
This is how it was up to v2.1.2 included (changed in v2.1.4 onward).
I added a benchmark that has 3 subscribers running and increase
the number of publishers: 1, 2, 5 and 10. This is the comparison
between the pre-PR and post-PR:

```
benchcmp old.txt new.txt
benchmark                           old ns/op     new ns/op     delta
Benchmark___BumpPubCount_1x3-16     396           385           -2.78%
Benchmark___BumpPubCount_2x3-16     495           406           -17.98%
Benchmark___BumpPubCount_5x3-16     542           395           -27.12%
Benchmark__BumpPubCount_10x3-16     549           515           -6.19%

benchmark                           old MB/s     new MB/s     speedup
Benchmark___BumpPubCount_1x3-16     717.27       737.54       1.03x
Benchmark___BumpPubCount_2x3-16     574.31       699.02       1.22x
Benchmark___BumpPubCount_5x3-16     524.35       718.80       1.37x
Benchmark__BumpPubCount_10x3-16     517.26       551.53       1.07x
```

It is inline with what the user reported, seeing a 20% drop in performance
when going from 1 publisher to 2. But, as we can see, the difference
between go channel and cond variable reduces with the increased number
of publishers after a certain number.

I am not sure of the performance impact on other situations, so this
PR is more of a proposal than a fix.

Resolves #1786

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-12 12:24:37 -07:00
Ivan Kozlovic
0d34688c4b Merge pull request #1800 from nats-io/fix_1799
[FIXED] Monitoring endpoint `connz?auth=true` show incorrect user
2021-01-11 14:28:28 -07:00
Ivan Kozlovic
f50c655e75 [FIXED] Monitoring endpoint connz?auth=true show incorrect user
Only the user (from username/password connection method) was reported
in this monitoring endpoint. Will now report proper nkey, public key,
etc..

Resolves #1799

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-01-11 12:59:05 -07:00
Matthias Hanel
b88cbe2e0d Merge pull request #1798 from nats-io/lexer-timeout-2
[fiixed] infinite loop in config parser for include with quote
2021-01-08 13:40:47 -05:00
Matthias Hanel
fc667aaafd [fiixed] infinite loop in config parser for include with quote and double quote
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-08 13:17:19 -05:00
Matthias Hanel
c5c8e385ab Merge pull request #1797 from nats-io/jwt-queue-perms
Added tests for cfg/jwt based queue restrictions and updated jwt lib
2021-01-07 20:06:05 -05:00
Matthias Hanel
431b642cbe Incorporating review comments
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-07 18:19:25 -05:00
Matthias Hanel
0ff6252692 Added tests for cfg/jwt based queue restrictions and updated jwt lib
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-07 17:30:51 -05:00
Ivan Kozlovic
ceb1fda202 Merge pull request #1795 from nats-io/add_dependency_doc
Create dependencies.md [ci skip]
2021-01-07 09:05:21 -07:00
R.I.Pienaar
fdd26b1d88 Merge pull request #1796 from ripienaar/nightly_1.15
use go 1.15 for nightly builds
2021-01-07 15:09:09 +01:00
R.I.Pienaar
b852a9ba84 use go 1.15 for nightly builds
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-01-07 13:54:50 +01:00
Ginger Collison
083846e41f Create dependencies.md [ci skip] 2021-01-06 10:53:35 -06:00
Matthias Hanel
9bdbe576ab Merge pull request #1793 from nats-io/jwt-resp-threshold
[Added] support for jwt export response threshold
2021-01-05 20:45:59 -05:00
Matthias Hanel
4649f9e691 [fixed] timeout in configuration lexer found by oss-fuzz (#1792)
* [fixed] timeout in configuration lexer found by oss-fuzz

Peek followed by next resulted in an infinite loop when eof was not
checked.
I looked for all instances of this pattern and return an error when eof is not already checked or skip was used.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-05 20:07:19 -05:00
Matthias Hanel
1149c4cef9 [Added] support for jwt export response threshold
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-05 19:52:52 -05:00
Matthias Hanel
4699779f72 Merge pull request #1790 from nats-io/import-rewrite
[Added] support for wildcard services and import remapping by JWT.
2021-01-05 19:43:06 -05:00
Matthias Hanel
5efab7bafd Merge pull request #1791 from nats-io/lexer
[fixed] two minor configuration lexer issues found by oss-fuzz
2021-01-05 19:28:05 -05:00
Matthias Hanel
d59b074c64 Incorporating review comments
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-05 18:45:46 -05:00
Matthias Hanel
32b5a16d97 [fixed] two minor configuration lexer issues found by oss-fuzz
after eof isVariable had a buffer overflow
stringStateFn was not set when lexString was returned

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-05 18:25:41 -05:00
Matthias Hanel
67ca277142 Incorporating review comment
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-04 20:02:43 -05:00
Matthias Hanel
592a6447a7 [Added] support for wildcard services and import remapping by JWT.
Imports in JWT where extended to contain a new filed LocalSubject.
This Change pulls the new JWT library version in.
It was needed as prefix did not exist in the JWT library and the
original field could not be used. The field To has been deprecated.

When LocalSubject is set, service imports can be configured the same way
they are in config. Meaning, no reversal due to the type.

This change also ensures that wildcard references in transforms are only
set in To/LocalSubject. Before, for services, $1 would have to be set in Subject.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-01-04 14:11:36 -05:00
Ivan Kozlovic
de1e492858 Merge pull request #1787 from scottf/stream-headers-colon-no-space
stream handle headers with no space after colon
2021-01-04 09:18:02 -07:00
Derek Collison
3ff0576965 Merge pull request #1788 from paoloteti/syslog
[FIXED]: syslog Warnf call Notice() instead of Warning()
2021-01-04 05:17:43 -07:00
Paolo Teti
e148c540e2 [FIXED]: syslog Warnf call Notice() instead of Warning()
Use Warning() instead of Notice() and fix documentation for both
syslog and Windows event log.

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
2021-01-03 16:28:09 +01:00
scottf
bd954561bf stream handle headers with no space after colon 2021-01-03 09:47:15 -05:00
Ivan Kozlovic
d56ba231d3 Merge pull request #1785 from nats-io/fix_gw_implicit_reconnect
Fixed GW implicit reconnection
2020-12-30 11:19:12 -07:00
Ivan Kozlovic
d24e9b75b3 Fixed GW implicit reconnection
PR #1412 had a fix for races during implicit GW reconnection.
However, the fix was a bit too simplistic in that it was checking
only if there was any inbound gateway to decide to try to reconnect
an implicit disconnected GW. We need to check the name, not only
presence of inbound GW connections.

Related to #1412

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-28 12:28:55 -07:00
Ivan Kozlovic
e04d3d5a0a Merge pull request #1782 from nats-io/fix_1781
Fixed headers support for inbound leafnode connection
2020-12-21 12:41:53 -07:00
Ivan Kozlovic
14aecb2202 Fixed headers support for inbound leafnode connection
The server that solicits a LeafNode connection does not send an
INFO, so the accepting side had no way to know if the remote
supports headers or not. The solicit side will now send the headers
support capability in the CONNECT protocol so that the receiving
side can mark the inbound connection with headers support based
on that and its own support for headers.

Resolves #1781

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-21 11:53:24 -07:00
Alberto Ricart
f09992a889 updated iteration of signing keys (previously a list, now a map). (#1779) 2020-12-17 13:59:18 -07:00
Ivan Kozlovic
d7741b9aa1 Merge pull request #1776 from nats-io/jwt-headers
[Added] ability to use jwt latency sampling properties headers/share
2020-12-16 12:44:04 -07:00
Matthias Hanel
c6daffbfcc [Added] ability to use jwt latency sampling properties headers/share
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-12-16 14:34:09 -05:00
Ivan Kozlovic
1e14c3d560 Merge pull request #1777 from nats-io/update_go_mod
Updated go mod/vendor due to PR #1737
2020-12-16 12:32:15 -07:00
Ivan Kozlovic
a79a4d9834 Updated go mod/vendor due to PR #1737
The PR #1737 added a new file with an import of "golang.org/x/sys/unix"
but vendor directory was not updated.

Related to #1737

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-16 12:19:31 -07:00