Giter Site home page Giter Site logo

Comments (8)

pouriyajamshidi avatar pouriyajamshidi commented on May 29, 2024 1

Hi @sonarypt,

Well, this one is a bit tricky. In order to reproduce:

starting tcpinging a host, say example.com:

tcping example.com 443 -r 2

then disconnect your internet access πŸ˜„ and watch the behavior. You will see that the retry resolve takes a few seconds to timeout and we are not adding those seconds to the total downtime.

Let me know if you need more info.

from tcping.

doclai avatar doclai commented on May 29, 2024 1

Uhm, I tried your scenario on my machine (Arch Linux - amd64 - go1.18.4). Previously using wifi, I disconnected my internet access by command nmcli radio wifi off. I also add line into printRetryingToResolve() that print out total down time to the terminal. Eventually, retrying to resolve does not take any extra second to timeout. Everything seems to be smooth.

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on May 29, 2024 1

yea, I also tried again and I don't see any hiccups like before. Now I wonder how it had occurred. Because it was the reason to open a ticket for it.

Let's try some more and if it does not occur again, we can close this for now.

from tcping.

icemint0828 avatar icemint0828 commented on May 29, 2024 1

@pouriyajamshidi
I can see the event happening with the procedure that pouriya mentioned (tcping example.com 443 -r 2 and wifi on/off).

γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2022-07-22 12 11 44

from tcping.

icemint0828 avatar icemint0828 commented on May 29, 2024 1

@pouriyajamshidi
Perhaps the problem may not occur depending on when you turn on.
The way tcping is designed, if you don't turn it on just before the retry runs, it will continue to use the previous IP address.
Since the old IP is still available (the example.com IP address remains the same), I don't think the problem will occur.

Sorry for the multiple widths, but I'll put up a timed screenshot of when the problem occurs.

retrying to resolve example.com
time for retrying to resolve 809ms

γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2022-07-22 12 37 13

func retryResolve(tcpStats *stats) {
	if tcpStats.ongoingUnsuccessfulPkts > *tcpStats.retryHostnameResolveAfter {

		connStart := getSystemTime()

		tcpStats.printRetryingToResolve()
		tcpStats.ip = resolveHostname(tcpStats)
		tcpStats.ongoingUnsuccessfulPkts = 0
		tcpStats.retriedHostnameResolves += 1
		
		connEnd := time.Since(connStart)
		rtt := connEnd.Milliseconds()
		colorLightYellow("time for retrying to resolve %dms\n", rtt)
	}
}

I guess that this event occurs several times over a long period of time, eventually resulting in a few seconds difference.
I can't take the time to get to the solution successfully, but if you need help again, please call me!

from tcping.

doclai avatar doclai commented on May 29, 2024

After virtualized a webserver for demo, by adding local domain to /etc/hosts, turning on/off the webserver, I still cannot simulate any situation when that function takes 4~5 seconds to timeout. Could you give more information for that scenario?

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on May 29, 2024

@t-ohtaki do you know a situation which this can be triggered?

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on May 29, 2024

Thanks a lot @icemint0828. Helpful as always.

I hope this clears the issue @sonarypt

from tcping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.