Commit Graph

3210 Commits

Author SHA1 Message Date
Phil Pennock
cceeb94166 WIP: add best guess prominent socket stats logging 2020-10-13 19:53:45 -04:00
Phil Pennock
331f6ca3aa WIP: theoretically, populate expvar maps 2020-10-13 19:53:35 -04:00
Phil Pennock
65be9706b3 WIP: socket stats
At this point, we're collecting for gateways, we have the general framework in
place, and we're populating unpublished expvars.
2020-10-13 18:26:28 -04:00
Ivan Kozlovic
99cb1fb3f0 Merge pull request #1640 from nats-io/jwt-remove
Fixed crash on non existing directory
2020-10-13 09:13:53 -06:00
Matthias Hanel
60c8cbd1f2 Fixed crash on non existing directory
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-10-13 01:30:03 -04:00
Ivan Kozlovic
a4c68521ba Merge pull request #1639 from nats-io/jwt-remove
Adding list/delete/update operations for jwt stored by nats-resolver
2020-10-12 18:20:18 -06:00
Matthias Hanel
8d8f6480d7 Incorporating comments
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-10-12 19:21:32 -04:00
Matthias Hanel
bb63fd5f40 Adding list/delete/update operations for jwt stored by nats-resolver
Update already existed scoped by account, this exposes update without account.
List returns a list of all stored accounts.
Delete deletes accounts.
Fix a crash on startup with non existing directory.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-10-12 18:07:07 -04:00
Waldemar Quevedo
aead978be9 Merge pull request #1638 from nats-io/revert-1637-nightly-bin-path
Revert "Update nightly image server binary path"
2020-10-10 09:37:58 -07:00
Waldemar Quevedo
1bc03cd95e Revert "Update nightly image server binary path" 2020-10-09 16:54:59 -07:00
Jaime Piña
23a56591a7 Merge pull request #1637 from nats-io/nightly-bin-path
Update nightly image server binary path
2020-10-09 15:14:35 -07:00
Jaime Piña
9f94cb5fb7 Update nightly image server binary path
Currently, the NATS operator doesn't work with the nightly NATS Server images because binary is in a different location. This symlinks the binary to a few different known paths.
2020-10-09 14:44:07 -07:00
Ivan Kozlovic
fec5b7fdef Merge pull request #1635 from nats-io/sys-acc-rev-fix
Skip revocation check if the client has no jwt and is therefore internal
2020-10-09 12:57:15 -06:00
Matthias Hanel
db44b589fc Skip revocation check if the client has no jwt and is therefore internal
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-10-09 14:41:32 -04:00
Ivan Kozlovic
618cde9039 Merge pull request #1634 from nats-io/warn_duplicate_server_name
Accepting route warns if remote server has same name
2020-10-09 10:19:40 -06:00
Ivan Kozlovic
13df1a55fd Changed warning message
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-10-09 09:36:30 -06:00
Ivan Kozlovic
df9d5f5fd9 Accepting route warns if remote server has same name
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-10-08 17:59:33 -06:00
Ivan Kozlovic
b6d2c9ff64 Merge pull request #1633 from nats-io/change_tls_and_aut_default_timeout
[CHANGED] Default TLS and Auth timeout
2020-10-08 16:40:43 -06:00
Ivan Kozlovic
9b6385d6e7 [CHANGED] Default TLS and Auth timeout
The default TLS timeout has been bumped to 2 seconds.
The default Auth timeout is now 2 seconds, but if TLS config
is present, it is equal to TLS timeout (possibly default value) + 1s.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-10-08 16:15:30 -06:00
Ivan Kozlovic
5ad31022e2 Merge pull request #1632 from nats-io/expiration
[Fixed] revocation check used current time instead of jwt issue time
2020-10-07 08:52:39 -06:00
Matthias Hanel
387e1e1ee4 [Fixed] revocation check used current time instead of jwt issue time
Also empty revoked keys once account jwt has no revocations.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-10-06 21:45:34 -04:00
Ivan Kozlovic
f9bff10226 Merge pull request #1629 from nats-io/conns
Avoid unnecessary CONNS subscription
2020-10-05 16:38:00 -06:00
Matthias Hanel
4ff7b280f4 Avoid unnecessary CONNS subscription
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-10-05 18:25:51 -04:00
Ivan Kozlovic
6da5d2f490 Merge pull request #1628 from nats-io/ack_explicit_msg_removal
AckExplicit removes message for "offline" durable
2020-10-02 17:41:11 -06:00
Derek Collison
cdfb7ba03b Remove delivery count check, could flap
Signed-off-by: Derek Collison <derek@nats.io>
2020-10-02 16:30:40 -07:00
Derek Collison
9ad408e0b3 Use closed variable on consumer, don't check consumer sequences
Signed-off-by: Derek Collison <derek@nats.io>
2020-10-02 16:21:23 -07:00
Derek Collison
8a9f6eaf42 Additional fixes to interest retention based streams and offline durables with redelivery.
Signed-off-by: Derek Collison <derek@nats.io>
2020-10-02 12:58:59 -07:00
Derek Collison
a75be04b0a Various fixes for this PR.
- Fix for updating delivery subject and adjusting next delivery sequences.
- When acking explicitly but out of order, need to make sure we set floor correctly.
- Only update ack floors on an ack if the message is present.
- Fix for needAck for explicitAck out of order consumers detecting if message has been acked.
- Fix for race not locking stream when checking interest during stop.
- Fix for filestore determing if a message block still has a message. Added check to first sequence as well as cache.
- Some additions to the original test.

Signed-off-by: Derek Collison <derek@nats.io>
2020-10-01 21:24:40 -07:00
Ivan Kozlovic
eff27e26be AckExplicit removes message for "offline" durable
The test shows the issue.
It seems that Consumer.needAck() for AckExplicit should consider
that an Ack is needed if sseq > o.asflr and there is no pending
ack at all. However making this change would break the test
TestJetStreamInterestRetentionStream.

Also, running the new test with `-count 100` and by adding an
artificial delay in stream.ackMsg() (just before calling
mset.store.RemoveMsg(seq)) causes sometimes delete requests
for the same sequence to be processed twice, which causes
the new test to fail (even with an attempted fix as discussed
above). I think that the attempt to remove the same sequence twice
is messing up the state.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-10-01 12:22:02 -06:00
Ivan Kozlovic
8989fb6524 Merge pull request #1625 from nats-io/bump_version
Bump version
2020-09-29 19:25:46 -06:00
Ivan Kozlovic
7b03edb792 Bump version
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-29 19:23:12 -06:00
Ivan Kozlovic
82867229e0 Merge pull request #1624 from nats-io/bad-jwt
Updated jwt library and check (account & token) issuer prior to jwt Validate
2020-09-29 19:21:18 -06:00
Matthias Hanel
08e37e0d94 Updated jwt library and check (account/token) issuer prior to jwt Validate
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-29 21:03:40 -04:00
Ivan Kozlovic
53b5fa8302 Merge pull request #1623 from nats-io/move_a_test_to_no_race
Moving TestQueueAutoUnsubscribe to norace_test.go
2020-09-29 18:21:55 -06:00
Ivan Kozlovic
0c804f5ffb Moving TestQueueAutoUnsubscribe to norace_test.go
This test has been found to cause TestAccountNATSResolverFetch to
fail on macOS. We did not find the exact reason yet, but it seem
that with `-race`, the queue auto-unsub test (that creates 2,000
queue subs and sends 1,000 messages) cause mem to grow to 256MB
(which we know -race is memory hungry) and that may be causing
interactions with the account resolver test.

For now, moving it to norace_test.go, which consumes much less
memory (25MB) and anyway is a better place since it would stress
better the "races" of having a queue sub being unsubscribed while
messages were inflight to this queue sub.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-29 18:06:16 -06:00
Ivan Kozlovic
695bb8250f Merge pull request #1616 from nats-io/nats-resolver-gateway
Adding fetch on missing jwt of full nats based resolver
2020-09-29 14:22:26 -06:00
Matthias Hanel
01453e03cd Add defer srv.Shutdown() where manual shutdown was done
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-29 15:54:20 -04:00
Matthias Hanel
4e055d7b72 Fixing test race condition
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-29 14:36:04 -04:00
Matthias Hanel
f3e6cd12ec Adding fetch on missing jwt of full nats based resolver
Full nats based resolver sync within a cluster.
This functionality addresses syncing between cluster.

Fixing deadlock when more than one server responds to lookup.
Fixing crash when shutdown and pack happen at the same time.
2020-09-29 14:36:04 -04:00
Ivan Kozlovic
3d00001e21 Merge pull request #1617 from nats-io/conns-event
Fix event ordering issue caused by re-locking
2020-09-29 11:53:54 -06:00
Ivan Kozlovic
f5934a8d31 Merge pull request #1622 from nats-io/js_panic_cons_delete
Fixed possible panic on consumer.Delete() during server Shutdown()
2020-09-29 11:52:23 -06:00
Matthias Hanel
dcb1f6ff01 Avoid blocking when holding account lock.
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-29 13:15:45 -04:00
Ivan Kozlovic
3977ea04f5 Fixed possible panic on consumer.Delete() during server Shutdown()
The panic was caused by the closing of an already closed Go channel.
The Delete() relied on the consumer's mset being nil to consider
the consumer already closed. However, the consumer's mset is set
to nil after invoking sendDeleteAdvisoryLocked() which internally
invokes sendAdvisory() which releases/reacquires the consumer lock.
This left an open door for a race to occur and Delete() to be
invoked twice on the same consumer.

Moving setting the consumer's mset to nil too early would prevent
the sendAdvisory() to actually do its job. We could pass the mset
to sendAvisory(), but a simpler approach is to simply use a "closed"
boolean on the Consumer object that is set to true at the beginning
of the Delete() function.

Resolves #1621

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-29 10:01:47 -06:00
Derek Collison
7f44d075f7 Merge pull request #1601 from ripienaar/skip_ack_on_acknxt
Do not ack to AckNxt
2020-09-28 17:19:35 -07:00
Ivan Kozlovic
467c0b265c Merge pull request #1620 from nats-io/js_durable_reconnect
AddConsumer causes redelivery of first message
2020-09-28 18:06:52 -06:00
Derek Collison
9129d7b62f Set to 1 if no acks received, fixes #1619
Signed-off-by: Derek Collison <derek@nats.io>
2020-09-28 15:56:50 -07:00
Ivan Kozlovic
5506b96baa AddConsumer causes redelivery of first message
It seems that when updating the delivery subject, we use as the
first sequence the ack floor, but if no message was ever ack'ed
then it causes the first message to be redelivered twice.

Resolves #1619

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-28 12:28:57 -06:00
Matthias Hanel
d343ba78bc Fix event ordering issue caused by re-locking
Noticed TestSystemAccountConnectionUpdatesStopAfterNoLocal failing
du to the timer still being around.
To avoid one event interfering with antoher, holding the account lock
during send seems the most appropriate solution.
sendInternalMsg essentially records the send queue and unlocks the server.
This change just merges that with the code in sendAccConnsUpdate.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-26 17:12:18 -04:00
Ivan Kozlovic
2792fd2ef1 Merge pull request #1612 from nats-io/sys-evt-cleanup
[Added] filtering by account to leafz and exposing this as per acc subject
2020-09-24 17:15:53 -06:00
Ivan Kozlovic
b19b2e17d5 Merge pull request #1614 from nats-io/conns-race
[Fixed] race condition where account conns timer was disabled too soon
2020-09-24 17:06:03 -06:00