zOS is an IBM Z (mainframe) operating system. In the days of yore, it
was MVS.
- [ ] Link to issue, e.g. `Resolves #NNN`
- [ ] Documentation added (if applicable)
- [ ] Tests added
- [x] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [x] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [x] Build is green in Travis CI
- [x] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)
Resolves - the inability to build on zOS.
### Changes proposed in this pull request:
- This PR adds a couple of files to allow building nats-server on zOS.
Multiple tests were using the same port numbers and it seems that the
NATS Servers were not always shutting down quickly enough or the test is
reusing a port that was already assigned ephemerally, resulting in
`listen tcp 127.0.0.1:50554: bind: address already in use` failures.
Signed-off-by: Neil Twigg <neil@nats.io>
Multiple tests were using the same port numbers and it seems that the
NATS Servers were not always shutting down quickly enough, resulting
in `listen tcp 127.0.0.1:50554: bind: address already in use` failures.
Signed-off-by: Neil Twigg <neil@nats.io>
As of Go 1.20, `math/rand.Read` is deprecated. In addition to that, it
also isn't recommended for use in combination with anything
cryptographic.
I haven't replaced all `math/rand` imports with `crypto/rand` imports
because there are still some legitimate uses for the `math/rand` package
in some places.
Signed-off-by: Neil Twigg <neil@nats.io>
Only discard messages from MQTT QoS0 from internal JetStream clients if
really a QoS1 JetStream publish, not just a JetStream client.
Signed-off-by: Derek Collison <derek@nats.io>
Resolves#4291
As of Go 1.20, `math/rand.Read` is deprecated. In addition to that, it also
isn't recommended for use in combination with anything cryptographic.
I haven't replaced all `math/rand` with `crypto/rand` imports because there
are still some legitimate uses for the `math/rand` package in some places.
Signed-off-by: Neil Twigg <neil@nats.io>
When a queue subscriber was updated multiple times over a leafnode
connection we added in more shadow subscriptions which could become
zombies when the connection went away.
In a case where a leafnode server had multiple queue subscribers on the
same queue group, the hub server would add in multiple shadow subs.
These subs would not be properly cleaned up and could lead to stale
connections being associated with them.
Signed-off-by: Derek Collison <derek@nats.io>
In a case where a leafnode server had multiple queue subscribers on the same queue group, the hub server would add in multiple shadow subs. These subs would not be properly cleaned up and could lead to stale connections being associated with them.
Signed-off-by: Derek Collison <derek@nats.io>
- [X] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [X] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [x] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)
Fixes a behavior where idempotency of re-defining the same stream more
than once (with the same attributes) was broken due to the DeepEqual
failing due to the StreamSource struct received from the client app not
having a value for the `iname` structure field (as it's internal) but
the StreamSource struct return from `mset.config()` would have it set.
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
Streams with many interior deletes was causing issues due to the fact
that the interior deletes were represented as a sorted []uint64. This
could cause snapshots for streams R>1 and with lots of interior deletes
to take up more memory and cpu then we want.
This new approach introduces 3 sub types of delete blocks, an avl
bitmask tree, a run length encoding, and the legacy format above. We
also take into account large interior deletes such that on receiving a
snapshot we can skip things we already know about.
Signed-off-by: Derek Collison <derek@nats.io>
Streams with many interior deletes was causing issues due to the fact that the interior deletes were represented as a sorted []uint64.
This approach introduces 3 sub types of delete blocks, avl bitmask tree, a run length encoding, and the legacy format above.
We also take into account large interior deletes such that on receiving a snapshot we can skip things we already know about.
Signed-off-by: Derek Collison <derek@nats.io>
These tests are to help verify that routes aren't leaking when they go
down for write deadlines or auth failures.
Signed-off-by: Neil Twigg <neil@nats.io>