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

Output Issue in "ipfs ping" #6298

Closed
remmerw opened this issue May 5, 2019 · 2 comments
Closed

Output Issue in "ipfs ping" #6298

remmerw opened this issue May 5, 2019 · 2 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@remmerw
Copy link

remmerw commented May 5, 2019

Version information:

Type: Release 0.4.20

  • "bug": Using ipfs ping --enc=json --count=1 QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx

(changed PID)

Description:

Testing the output and function of ipfs ping
Example:
ipfs ping --enc=json --count=1 QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx

Ping Scenario: (2 Nodes)
One Node pings the second node (QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx) within the same network:

(Both nodes are "online")
ipfs ping --enc=json --count=1 QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx

Output:

{"Success":true,"Time":0,"Text":"PING QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx."}
{"Success":true,"Time":144643541,"Text":""}
{"Success":true,"Time":0,"Text":"Average latency: 144.64ms"}
-> ok

Now switch off the second node from network: (wait 2-3 sec)
ipfs ping --enc=json --count=1 QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx

Output:

{"Success":true,"Time":0,"Text":"PING QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx."}
{"Success":true,"Time":0,"Text":"Average latency: 0.00ms"}
-> Issue is here, reported as success (maybe only an issue of evaluating the result)

Some seconds later: (node 2 still not connected)

ipfs ping --enc=json --count=1 QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx
{"Success":true,"Time":0,"Text":"PING QmRZq4kheCH3R4NHjeJpd5b17JkRdDSBTYMLtuYtjjfxxx."}
{"Success":false,"Time":0,"Text":"Ping error: context deadline exceeded"}
-> all fine
@magik6k magik6k added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue labels May 6, 2019
@magik6k
Copy link
Member

magik6k commented May 6, 2019

Relevant code if anyone wants to dig into this - https://github.com/ipfs/go-ipfs/blob/master/core/commands/ping.go#L142

Stebalien added a commit to libp2p/go-libp2p that referenced this issue May 7, 2019
Otherwise, we can't return errors. This is a breaking change but unlikely to
have a large impact on anyone but go-ipfs.

Part of ipfs/kubo#6298
@Stebalien
Copy link
Member

We should be returning errors from ping. PR: libp2p/go-libp2p#626

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants