Commit Graph

2810 Commits

Author SHA1 Message Date
Derek Collison
413884d87f Update start time for readloop started, check RTT on flapper test
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-25 06:58:23 -07:00
Derek Collison
a695d7aeb7 Ignore if we do not have minimum measurements
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-25 06:58:23 -07:00
Ivan Kozlovic
e976e63099 Fixing some flappers
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-05-25 06:58:23 -07:00
Derek Collison
f0bfbd176e Merge pull request #1415 from nats-io/consumer_state
Write consumer state during stop if not deleting
2020-05-24 21:33:23 -07:00
Derek Collison
51ebd92a90 Merge pull request #1411 from ripienaar/js_preview_banner
adds a warning banner about the preview status
2020-05-24 05:59:52 -07:00
Derek Collison
e42dc4915f Write consumer state during stop if not deleting
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-23 13:07:56 -07:00
Ivan Kozlovic
ac58e5de30 Merge pull request #1414 from nats-io/save_leafnode_conn_in_temp_map_until_connect
[FIXED] Possible stall on shutdown with leafnode setup
2020-05-22 17:14:28 -06:00
Ivan Kozlovic
76772e4a29 Merge pull request #1412 from nats-io/fix_gw_implicit_reconnect_race
[FIXED] Race condition during implicit Gateway reconnection
2020-05-22 17:14:13 -06:00
Ivan Kozlovic
8f05bc5c46 [FIXED] Possible stall on shutdown with leafnode setup
If a leafnode connection is accepted but the server is shutdown
before the connection is fully registered, the shutdown would
stall because read and write loop go routine would not be
stopped.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-05-22 15:26:04 -06:00
Ivan Kozlovic
5dba3cdd75 [FIXED] Race condition during implicit Gateway reconnection
Say server in cluster A accepts a connection from a server in
cluster B.
The gateway is implicit, in that A does not have a configured
remote gateway to B.
Then the server in B is shutdown, which A detects and initiate
a single reconnect attempt (since it is implicit and if the
reconnect retries is not set).
While this happens, a new server in B is restarted and connects
to A. If that happens before the initial reconnect attempt
failed, A will register that new inbound and do not attempt to
solicit because it has already a remote entry for gateway B.
At this point when the reconnect to old server B fails, then
the remote GW entry is removed, and A will not create an outbound
connection to the new B server.

We fix that by checking if there is a registered inbound when
we get to the point of removing the remote on a failed implicit
reconnect. If there is one, we try the reconnection.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-05-22 13:01:17 -06:00
R.I.Pienaar
5504c1212d adds a warning banner about the preview status
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-22 18:32:24 +02:00
Derek Collison
0e3c73192d Merge pull request #1410 from ripienaar/remove_advisory_config
removes the configuration from advisories
2020-05-22 07:12:51 -07:00
R.I.Pienaar
09dca63efe removes the configuration from advisories
On reflection I think this is a bad idea,
it's enough to know there was a change we
do not need to expose this to potential 3rd
parties

Also since advisories are versioned but
configuration is not, this is awkward.

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-22 16:08:44 +02:00
Derek Collison
34faa65186 Merge pull request #1409 from ripienaar/js_action_advisories
create advisories for stream and consumer add/delete/modify
2020-05-22 06:34:52 -07:00
R.I.Pienaar
c407a3b9d7 create advisories for stream and consumer add/delete/modify
We now publish advisories when streams and consumers are added,
deleted and modified

Also rework how TypedEvents are created to be easier to use

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-22 15:20:16 +02:00
Ivan Kozlovic
90c1fdf6f7 Merge pull request #1407 from nats-io/remove_trace
Disable logs in test
2020-05-21 10:25:49 -06:00
Matthias Hanel
251cdcbcef Disable logs in test
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-05-21 11:37:53 -04:00
Derek Collison
a6761d0053 Remove GHA badge for now [ci skip] 2020-05-21 06:56:02 -07:00
Derek Collison
caa78a8284 Updated for link. 2020-05-21 05:22:44 -07:00
Derek Collison
f0d2947a74 Merge pull request #1406 from ripienaar/gh_actions
initial gh actions
2020-05-21 05:07:59 -07:00
R.I.Pienaar
119dc29d75 add a badge 2020-05-21 14:06:26 +02:00
R.I.Pienaar
71144b37c5 initial gh actions
Adds basic GH Workflow that runs tests on push and pr, coverage
is disabled.

The intention is to soft switch to GH Actions by just letting them
run next to travs for a while to get a feel for things

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-21 13:49:20 +02:00
Derek Collison
ceda7f9ca7 Merge pull request #1404 from nats-io/fs-test
Fix for test failure when racing against double deletes.
2020-05-20 15:42:28 -07:00
Derek Collison
3e5d0c343d Fix for test failure when racing against double deletes
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-20 15:23:39 -07:00
Ivan Kozlovic
131e276341 Merge pull request #1226 from nats-io/bearer-token
[ADDED] Support for JWT BearerToken
2020-05-20 14:53:13 -06:00
Ivan Kozlovic
e734f01989 [ADDED] Support for JWT BearerToken
Disables nonce signature for JWT that has the BearerToken boolean
set to true.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-05-20 13:54:56 -06:00
Ivan Kozlovic
bd976e6028 Merge pull request #1309 from nats-io/websocket
[ADDED] Websocket support
2020-05-20 13:14:28 -06:00
Ivan Kozlovic
9715848a8e [ADDED] Websocket support
Websocket support can be enabled with a new websocket
configuration block:

```
websocket {
    # Specify a host and port to listen for websocket connections
    # listen: "host:port"

    # It can also be configured with individual parameters,
    # namely host and port.
    # host: "hostname"
    # port: 4443

    # This will optionally specify what host:port for websocket
    # connections to be advertised in the cluster
    # advertise: "host:port"

    # TLS configuration is required
    tls {
      cert_file: "/path/to/cert.pem"
      key_file: "/path/to/key.pem"
    }

    # If same_origin is true, then the Origin header of the
    # client request must match the request's Host.
    # same_origin: true

    # This list specifies the only accepted values for
    # the client's request Origin header. The scheme,
    # host and port must match. By convention, the
    # absence of port for an http:// scheme will be 80,
    # and for https:// will be 443.
    # allowed_origins [
    #    "http://www.example.com"
    #    "https://www.other-example.com"
    # ]

    # This enables support for compressed websocket frames
    # in the server. For compression to be used, both server
    # and client have to support it.
    # compression: true

    # This is the total time allowed for the server to
    # read the client request and write the response back
    # to the client. This include the time needed for the
    # TLS handshake.
    # handshake_timeout: "2s"
}
```

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-05-20 11:14:39 -06:00
Derek Collison
12f9cccad9 Merge pull request #1402 from nats-io/jetstream
JetStream Merge
2020-05-19 17:06:19 -07:00
Derek Collison
050db531fc Bumping version
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 16:44:42 -07:00
Derek Collison
c9f78d6f79 Fixes post rebasing with master
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 16:38:19 -07:00
Derek Collison
476e339cf9 Race detection fix
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 16:36:08 -07:00
Derek Collison
99d1e56aac Don't send updates to leafnodes before all subs on init
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:56 -07:00
Derek Collison
915e3cd74e Header support for Leafnodes
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:56 -07:00
Derek Collison
0129a7fa09 Header support for GWs
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:56 -07:00
Derek Collison
dae309ee30 Fix flapper, wait for no clients
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
7b6352c991 Add timestamps to stream state for first and last, addresses #1396
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
5b369ad7dc Do not allow streams to overlap with our public API - https://github.com/nats-io/jetstream/issues/137
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
3b33eb3c13 Fix flapper
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
67e49148c5 Fix for race in selectMsgBlock
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
019c105ca7 Updates based on feedback, more tests, few bug fixes
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
f5ceab339a Server support for headers between routes
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
d8b475c4b0 Better way to retrieve header support
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
55c77d1e4e Added support for delivery of HMSG and support for older clients
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
d61f1f5d92 Add in support for client header bool in CONNECT and tests
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
d51566881e First pass at headers awareness for server
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
R.I.Pienaar
3ab203d164 typed messages adr
[ci skip]

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-19 14:33:06 -07:00
R.I.Pienaar
859a36e7ac ensures that the streams value is never null
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-19 14:33:06 -07:00
R.I.Pienaar
85da492096 initialize api response structs properly
when go json marshal a unset []string it puts
null in the body and not [] which then makes
it an invalid list of strings.

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-19 14:33:06 -07:00
R.I.Pienaar
ce26c65174 fix the type hint for msg_get
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-05-19 14:33:06 -07:00