fibercrypto / fibercrypto/skycoin

Early shutdown causes panic

Open
#790 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

To replicate, run the client and ctrl+c to quit during "Load blockchain..."

gnet/pool will panic with a nil `*Connection`

This is because of `strand("NewConnection",`, `pool.NewConnection` may return `nil, nil` unexpectedly (it should always be `non-nil, nil` or `nil, err`.

`strand` returns `nil` when quit. It should return an `ErrQuit`. However, when I changed it to return `ErrQuit`, the program hung on shutdown instead.

`strand` should return `ErrQuit` so that `strand` callers can expect that they received an error if their method was not called before returning. The program hang that occurs when `ErrQuit` is returned must be solved as part of this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.