Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outbound data architecture changes #680

Merged
merged 28 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e6f200b
Baseline order test and benchmarks
derekcollison Apr 2, 2018
b9c73e9
Changed sublist to avoid quadratic time in removal with large N
derekcollison Apr 14, 2018
8502fb1
Add fast slice for large psubs for Match
derekcollison Apr 16, 2018
e1ce792
Change to timer setup
derekcollison Apr 16, 2018
bb292d9
Re-enable benchmark tests
derekcollison Apr 16, 2018
25654a4
Collect pub permissions into own function
derekcollison May 9, 2018
6443762
Added large payload pub/sub benchmark
derekcollison May 23, 2018
481697e
New outbound data architecture
derekcollison May 24, 2018
50a9924
Slow consumer updates and latency improvements.
derekcollison May 25, 2018
766ef3b
Add max_pending and write_deadline to varz
derekcollison May 25, 2018
df574ce
varz cluster empty when not defined
derekcollison May 25, 2018
e64ac42
Check flushOutbound and snapshot write_deadline and max_pending
derekcollison May 25, 2018
e9178f1
Performance tweaks
derekcollison May 26, 2018
30e31d5
Test dynamic buffers, track short reads/writes
derekcollison May 28, 2018
3bdab1b
Remove 1.8 support, trigger on 1.10
derekcollison May 28, 2018
049db6e
Support for queue subscriber retries over routes
derekcollison Jun 1, 2018
26dafe4
Don't send route unsub with max
derekcollison Jun 1, 2018
d3213df
Fix data race
derekcollison Jun 2, 2018
3e2e8c9
Fixed bug reusing test sub
derekcollison Jun 2, 2018
955d8ee
require 1.9 or above, bug fix in test
derekcollison Jun 2, 2018
50bb4b9
delivery last activity update
derekcollison Jun 2, 2018
cc07d50
new subs collector
derekcollison Jun 4, 2018
4dd4d2b
lock users access
derekcollison Jun 4, 2018
6299e03
dynamic buffer updates
derekcollison Jun 4, 2018
d603c53
Big message optimizations, slow consumer updates
derekcollison Jun 5, 2018
844f376
Performance optimizations, beta3, fixes to various tests.
derekcollison Jun 11, 2018
4fb84e2
Avoid lock to server with client lock held
derekcollison Jun 12, 2018
f7cb616
Optimization per @cdevienne
derekcollison Jun 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: go
go:
- 1.8.x
- 1.9.x
- 1.10.x
- 1.9.6
- 1.10.2
install:
- go get github.com/nats-io/go-nats
- go get github.com/mattn/goveralls
Expand All @@ -16,9 +15,9 @@ before_script:
- go vet $EXCLUDE_VENDOR
- misspell -error -locale US .
- megacheck $EXCLUDE_VENDOR
- if [[ "$TRAVIS_GO_VERSION" == 1.9.* ]]; then ./scripts/cross_compile.sh $TRAVIS_TAG; fi
- if [[ "$TRAVIS_GO_VERSION" == 1.10.* ]]; then ./scripts/cross_compile.sh $TRAVIS_TAG; fi
script:
- go test -i -race $EXCLUDE_VENDOR
- if [[ "$TRAVIS_GO_VERSION" == 1.9.* ]]; then ./scripts/cov.sh TRAVIS; else go test -v -race $EXCLUDE_VENDOR; fi
- if [[ "$TRAVIS_GO_VERSION" == 1.10.* ]]; then ./scripts/cov.sh TRAVIS; else go test -v -race $EXCLUDE_VENDOR; fi
after_success:
- if [[ "$TRAVIS_GO_VERSION" == 1.9.* ]] && [ "$TRAVIS_TAG" != "" ]; then ghr --owner nats-io --token $GITHUB_TOKEN --draft --replace $TRAVIS_TAG pkg/; fi
- if [[ "$TRAVIS_GO_VERSION" == 1.10.* ]] && [ "$TRAVIS_TAG" != "" ]; then ghr --owner nats-io --token $GITHUB_TOKEN --draft --replace $TRAVIS_TAG pkg/; fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A High Performance [NATS](https://nats.io) Server written in [Go](http://golang.

## Quickstart

If you just want to start using NATS, and you have [installed Go](https://golang.org/doc/install) 1.5+ and set your $GOPATH:
If you just want to start using NATS, and you have [installed Go](https://golang.org/doc/install) 1.9+ and set your $GOPATH:

Install and run the NATS server:

Expand Down
17 changes: 14 additions & 3 deletions server/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,28 @@ func (s *Server) checkAuthorization(c *client) bool {
}
}

// hasUsers leyt's us know if we have a users array.
func (s *Server) hasUsers() bool {
s.mu.Lock()
hu := s.users != nil
s.mu.Unlock()
return hu
}

// isClientAuthorized will check the client against the proper authorization method and data.
// This could be token or username/password based.
func (s *Server) isClientAuthorized(c *client) bool {
// Snapshot server options.
opts := s.getOpts()

// Check custom auth first, then multiple users, then token, then single user/pass.
if s.opts.CustomClientAuthentication != nil {
return s.opts.CustomClientAuthentication.Check(c)
} else if s.users != nil {
if opts.CustomClientAuthentication != nil {
return opts.CustomClientAuthentication.Check(c)
} else if s.hasUsers() {
s.mu.Lock()
user, ok := s.users[c.opts.Username]
s.mu.Unlock()

if !ok {
return false
}
Expand Down
Loading