Commit Graph

393 Commits

Author SHA1 Message Date
Derek Collison
3f39c244e4 Fixes for comments
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-21 17:37:40 -07:00
Ivan Kozlovic
bf3bc81722 Add route permissions
The `client.perms` struct is left unchanged. We simply map Import
and Export semantics to existing Publish and Subscribe ones.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-21 17:04:10 -06:00
Derek Collison
17fecd4c9b Support CID in client INFO, allow filtering /connz by CID
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-21 15:23:15 -07:00
Derek Collison
c218d9b0ec Fix for #278
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-20 22:41:05 -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
f7cb616cd2 Optimization per @cdevienne
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-12 13:38:13 -07:00
Derek Collison
4fb84e229c Avoid lock to server with client lock held
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-12 12:55:50 -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
d603c53f67 Big message optimizations, slow consumer updates
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
6299e034cb dynamic buffer updates
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
50bb4b9a1b delivery last activity update 2018-06-04 17:45:05 -07:00
Derek Collison
049db6e854 Support for queue subscriber retries over routes
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
30e31d5cd2 Test dynamic buffers, track short reads/writes
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
e9178f1f42 Performance tweaks
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
e64ac424c1 Check flushOutbound and snapshot write_deadline and max_pending
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -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
481697ef67 New outbound data architecture
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
25654a4632 Collect pub permissions into own function 2018-06-04 17:45:05 -07:00
Derek Collison
8502fb1edc Add fast slice for large psubs for Match
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
b9c73e96ee Changed sublist to avoid quadratic time in removal with large N
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Ivan Kozlovic
705d8f5fe8 Fix last activity monitoring test
This test originally used only 1 connection. It was then modified
to use another connection to check the publishing effect into
the last activity. However, when polling for connz we were using
[0], but that may not necessarily match the connection we were
checking.
I don't think that there was a need for a new connection in this
test, so use a single connection.
2018-03-23 14:20:16 -06:00
Ivan Kozlovic
fb972bd0fc Remove ssl_required references 2018-03-23 13:40:10 -06:00
Derek Collison
b2a9ed97d6 Merge pull request #650 from nats-io/cncf
Move to CNCF and Apache 2 License
2018-03-16 16:23:10 -07:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic
6f9983291c Update comments 2018-03-12 15:53:11 -06:00
Ivan Kozlovic
ee8f001131 [IMPROVED] Better attempt at delivering messages to routed queue subs
This PR is based out of #633. It imroves parsing QRSID so that the
TestRouteQueueSemantics test now passes (when dealing with malformed
QRSID).
A test similar to what is reported in #632 was also added. This
test however, uncovers a race condition that will be fixed in a
separate PR.

Resolves #632
2018-03-09 14:45:52 -07:00
Ivan Kozlovic
1bd40f98d9 Merge branch 'master' of https://github.com/VidScale/gnatsd into VidScale-master 2018-03-09 14:42:22 -07:00
Ivan Kozlovic
999e0299d7 Remove unused code 2018-03-06 08:46:01 -07:00
Ivan Kozlovic
461ab96a58 Additional fix to #631
This is the result of flapping tests in go-nats that were caused
by a defect (see PR https://github.com/nats-io/go-nats/pull/348).
However, during debugging, I realize that there were also things
that were not quite right in the server side. This change should
make it the notification of cluster topology changes to clients
more robust.
2018-03-05 20:03:46 -07:00
Volodymyr Khoroz
791bfd4c37 [#632] - fix a race condition causing messages to be lost with non-zero max_msgs in a cluster 2018-03-05 18:36:24 +02: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
6fad293a21 [FIXED] Connz would "block" for TLS clients still in TLS handshake
If server requires TLS and clients are connecting, and a Connz
request is made while clients are still in TLS Handshake, the
call to tls.Conn.ConnectionState() would block for the duration
of the handshake. This would cause the overall http request to
take too long.
We will now not try to gather TLSVersion and TLSCipher from a
client that is still in TLS handshake.

Resolves #600
2017-11-09 09:47:05 -07:00
Waldemar Quevedo
c8f151ef51 Remove check for '\r\n' when processing pub args
The parser has already dropped CRLF by when `processPub`
is called, so can skip doing the these checks there.
2017-09-11 14:21:58 -07:00
Tyler Treat
713b1c5722 Fix permissions cache pruning
We were pruning the wrong cache.
2017-08-31 14:00:30 -05:00
Ivan Kozlovic
20926a6176 Added megacheck
This tool combines staticcheck, gosimple and unused.
Fixed reports from unused.
2017-08-11 17:28:18 -06:00
ingosus
5145723164 Fix subscriptions zombie at autounsubscribe on cluster 2017-07-21 12:42:41 +03:00
Ivan Kozlovic
2befd973cc Fixed DATA RACE and ensure route is not created/accepted on shutdown
- Created a setter for the closed flag.
- Check if route is closed under lock and set a boolean if so,
  so we don't check c.route outside of c's mutex.
- Ensure that we do not create a route on shutdown, which would
  leave a connection hanging (was seen in some config reload tests).
2017-07-19 10:42:18 -06:00
Tyler Treat
2a7af1b892 Move mpay field for memory alignment 2017-06-28 11:29:10 -05:00
Tyler Treat
d60085d7c3 Replace mpay locking with atomic 2017-06-22 16:17:31 -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
06d9aa7739 Fix race condition 2017-06-19 15:14:31 -05:00
Tyler Treat
56ab619498 First pass at implementing cluster reload 2017-06-16 15:53:07 -05:00
Tyler Treat
1e964e4aab Address CR feedback 2017-06-14 16:48:11 -05:00
Tyler Treat
44966230db Handle permissions changes on config reload 2017-06-13 16:04:38 -05:00
Tyler Treat
cc30af8ede Address code review feedback 2017-06-05 17:43:42 -05:00
Tyler Treat
c468abd15f Merge branch 'master' of github.com:nats-io/gnatsd into config_reload 2017-06-05 13:41:04 -05:00
Tyler Treat
28160f1de2 Remove global logger
gnatsd currently uses a global logger. This can cause some problems
(especially around the config-reload work), but global variables are
also just an anti-pattern in general. The current behavior is
particularly surprising because the global logger is configured through
calls to the Server.

This addresses issue #500 by removing the global logger and making it a
field on Server.
2017-05-31 16:06:31 -05:00
Tyler Treat
9902c3da84 First pass at implementing config reload 2017-05-30 16:18:36 -05:00
Derek Collison
76de921f65 Cleanup for Auth 2017-04-20 12:41:48 -07:00
Ivan Kozlovic
a0245fc0c8 [FIXED] Server not sending PINGs to TSL connections (clients or routes)
- Removed unnecessary cast check to (*net.TCPConn). When the timer
fires, the connection is already established. Replaced with check
that connection has not been closed.
- Add PING test that checks that pings are sent to TLS connections.
- Changed Go version to 1.7.5 in travis.
- Removed test package from code coverage.
2017-03-24 09:49:42 -06:00