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

pex create secret connection error and report EOF error #2763

Closed
unclezoro opened this issue Nov 6, 2018 · 7 comments
Closed

pex create secret connection error and report EOF error #2763

unclezoro opened this issue Nov 6, 2018 · 7 comments

Comments

@unclezoro
Copy link
Contributor

master branch ,my full node connected to seed node, and report

Receive  Ignoring inbound connection: error while adding peer module=p2p address=127.0.0.0:18116   err=Error{EOF}   and block for a while.

The problem in p2p/conn/secret_connection.go, the two handshake task is running in parallel, while it should happend in sequence. And function UnmarshalBinaryLengthPrefixedReader do not block while there is no message from connection.
The source code:

func shareEphPubKey(conn io.ReadWriteCloser, locEphPub *[32]byte) (remEphPub *[32]byte, err error) {

	// Send our pubkey and receive theirs in tandem.
	var trs, _ = cmn.Parallel(
		func(_ int) (val interface{}, err error, abort bool) {
			var _, err1 = cdc.MarshalBinaryLengthPrefixedWriter(conn, locEphPub)
			if err1 != nil {
				return nil, err1, true // abort
			}
			return nil, nil, false
		},
		func(_ int) (val interface{}, err error, abort bool) {
			var _remEphPub [32]byte
			var _, err2 = cdc.UnmarshalBinaryLengthPrefixedReader(conn, &_remEphPub, 1024*1024) // TODO
			if err2 != nil {
				return nil, err2, true // abort
			}
			return _remEphPub, nil, false
		},
	)

	// If error:
	if trs.FirstError() != nil {
		err = trs.FirstError()
		return
	}

	// Otherwise:
	var _remEphPub = trs.FirstValue().([32]byte)
	return &_remEphPub, nil
}
@unclezoro
Copy link
Contributor Author

unclezoro commented Nov 6, 2018

We are going to fix in our repo. I can put an pr by the way

@unclezoro
Copy link
Contributor Author

@ebuchman Could you have a look about thins issue, thks.

@ebuchman
Copy link
Contributor

ebuchman commented Nov 7, 2018

the two handshake task is running in parallel, while it should happend in sequence

Why should it happen in sequence? I'm not sure the handshake structure is the actual issue here since it works properly in most cases. That error message might take a bit more digging, but maybe I'm missing something?

@ebuchman
Copy link
Contributor

ebuchman commented Nov 7, 2018

Oh I think this might be #2092 / #1988. Can we close this for those? I will close one of those as well

@unclezoro
Copy link
Contributor Author

Yes, you can close this.

@unclezoro unclezoro reopened this Nov 7, 2018
@unclezoro
Copy link
Contributor Author

I turn off seed_mode and the problem still exists. Error message like this:

I[11-07|08:14:23.367] Inbound Peer rejected                        
module=p2p err="auth failure: secrect conn failed: EOF, src: 172.22.23.12:59834" numPeers=1

@unclezoro
Copy link
Contributor Author

It it because of Elb health check....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants