Fixed dios capacity to 4 due to testing under heavy load.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-02-28 07:50:23 -08:00
parent b19fe508c4
commit adbb50fc21
2 changed files with 3 additions and 3 deletions

View File

@@ -6836,7 +6836,7 @@ var dios chan struct{}
// golang.org's semaphore seemed a bit heavy.
func init() {
// Based on Go max threads of 10k, limit ourselves to a max of 1k blocking IO calls.
const nIO = 1024
const nIO = 4
dios = make(chan struct{}, nIO)
// Fill it up to start.
for i := 0; i < nIO; i++ {

View File

@@ -853,9 +853,9 @@ func (s *Server) signalPullConsumers() {
// Shutdown jetstream for this server.
func (s *Server) shutdownJetStream() {
s.mu.Lock()
s.mu.RLock()
js := s.js
s.mu.Unlock()
s.mu.RUnlock()
if js == nil {
return