Comments (5)
I will take a closer look at the trace, but in general under spinUpSockerWatchers, the nc.wg.Wait() is there to make sure the readLoop and flusher from the old connection are torn down before the new ones get spun up.
from nats.go.
I understand what the waitgroup is for. You can easily run into situations where it may not complete because the readLoop and flushers have moved to the new connection/buffered writer. It doesn't always happen but it can.
The stack just shows the situation when something similar happens with the parser state.
There is a lot of code checking for the state of the connection, closed, reconnecting, etc... but for most of the routines they will see connected or closed because of the locking and how they are driven.
from nats.go.
I looked briefly, and I think doReconnect() can only proceed at replacing the nc.bw and the connection itself after it is known that readLoop and flusher are shutdown. Will look at moving that logic gate to before reconnect begins in earnest.
from nats.go.
I found a bug here from the last commit which may cause you issues. I am working on this problem (this thread), and found it as I was moving the shutdown logic to before we began processing a reconnect.
https://github.com/apcera/nats/blob/master/nats.go#L1438
from nats.go.
I have it fixed, just an FYI..
from nats.go.
Related Issues (20)
- kv watcher always fails on buckets with lots of KVs HOT 1
- Add stream compression option for KV HOT 3
- `JetStreamManager` list methods swallow error response HOT 3
- Proposal to update channel subscriptions behavior and/or documentation around Pending and Draining
- For K/V with history, WatchAll does not return all keys if jetstream.MemoryStorage is used HOT 2
- Acking a JetStream message for the 3rd time blocks code execution HOT 4
- Panic when calling consContext.Stop() HOT 1
- How can fetch return immediately when the subject is empty? HOT 1
- `jetstream.PublishMsg` is not guaranteed to return `ErrNoStreamResponse` when there is no stream configured HOT 5
- `jetstream.PublishMsgAsync` ignores `jetstream.WithRetryAttempts` and `jetstream.WithRetryWait` options
- No heartbeat on MessagesContext is not instance of `ErrNoHeartbeat` HOT 3
- Data Race in Jetstream Consume HOT 2
- NATS JetStream Pull Subscribe Not delivering messages on a Work Queue intermittently
- Proper timeout handling in `func (*pullConsumer) fetch()` HOT 1
- Client labels or custom attributes HOT 2
- KV and Object need to allow for an option to limit the number of entries they return when listing keys HOT 1
- [KV] KeyValueStoreNames() in new API returns stores prefixed by `KV_`
- Add start revision option for KVStore
- obj store api returns stream not found instead of bucket not found HOT 1
- MaxPending gives decrease number
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nats.go.