-
Notifications
You must be signed in to change notification settings - Fork 241
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
can‘t connect to ws server in v0.7.0 #500
Comments
What's the problem do you think, I am willing to dig into the issue, please share your findings. |
My findingsIn blockHeadersSub, err := is.eventBus.SubscribeUnbuffered(
context.Background(),
subscriber,
types.EventQueryNewBlockHeader)
if err != nil {
return err
}
txsSub, err := is.eventBus.SubscribeUnbuffered(context.Background(), subscriber, types.EventQueryTx)
if err != nil {
return err
} In func (state *state) send(msg interface{}, events map[string][]string) error {
for qStr, clientSubscriptions := range state.subscriptions {
q := state.queries[qStr].q
match, err := q.Matches(events)
if err != nil {
return fmt.Errorf("failed to match against query %s: %w", q.String(), err)
}
if match {
for clientID, subscription := range clientSubscriptions {
if cap(subscription.out) == 0 {
// block on unbuffered channel
--> subscription.out <- NewMessage(msg, events)
} else {
// don't block on buffered channels
select {
case subscription.out <- NewMessage(msg, events):
default:
state.remove(clientID, qStr, ErrOutOfCapacity)
}
}
}
}
}
return nil
} SolutionI changed |
Three days passed, still works. @yihuang |
awsome, so the issue is dead lock on unbuffered channel? Can you open a PR to tendermint directly? |
I don't know how to effectively reproduce the issue and am not sure if there are other side effects. |
Hi @huahuayu, I think the What's your Do you need to use |
I think ws server issue will eventually be fixed by this solution:#665 |
Env
cronos: 0.6.5 and 0.7.0
Issue
Can't subscribe newHead and newTxs:
SubscribeNewHeads / newTxs from golang
Subscribe from
wscat
Behavior in v0.6.5
You can connect to ws after restarting, it works only 5-10 mins, then you get error and need another restart.
Behavior in v0.7.0
Today I upgrade to v0.7.0, the longest record I have is about 1 hour, within that 1 hour, I can subscribe newHead and newTx, I test it many times, so I thought it is been fixed in v0.7.0.
But when I tried again just now, I can't connect ws server anymore. Even restarting cronosd is useless.
The issue is still there.
@yihuang Please help to check, thx.
The text was updated successfully, but these errors were encountered: