Closed blnprasad closed 3 years ago
This may be related to some attacks that we've been getting on some of our servers.
I could still see its failing but always working with UI. when I debugged I found that due to some race condition, it stuck at collecting ping results job. with below changes I found it always working.
git diff speedtest/speedtest.go
diff --git a/speedtest/speedtest.go b/speedtest/speedtest.go
index 4323560..ac2bae5 100644
--- a/speedtest/speedtest.go
+++ b/speedtest/speedtest.go
@@ -258,8 +258,8 @@ func SpeedTest(c *cli.Context) error {
log.Info("Selecting the fastest server based on ping")
var wg sync.WaitGroup
- jobs := make(chan PingJob, 10)
- results := make(chan PingResult, 10)
+ jobs := make(chan PingJob, len(servers))
+ results := make(chan PingResult, len(servers))
done := make(chan struct{})
Nice catch! Would you mind submitting a PR?
sure. I do not have permissions to push remote branch and raise PR.
You can fork the repo into your own namespace and make changes there, then you can submit PR from your repo.
thanks. i've raised PR for same.
Merged, thanks!
Closing this issue now.
seems like speed test from cli failing. but same working from UI.
out/librespeed-cli-linux-amd64 Retrieving server list from https://librespeed.org/backend-servers/servers.php Selecting the fastest server based on ping Error checking for server status: Get "https://speedtest5.wegozyn.eu/backend/empty.php": dial tcp: lookup speedtest5.wegozyn.eu on 8.8.8.8:53: no such host Server Frankfurt am Main, Germany (speedtest5.wegozyn.eu) doesn't seem to be up, skipping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Server New York, United States (1) (BuyVM) (ny1.backend.librespeed.nixnet.services) doesn't seem to be up, skipping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Failed to ping target host: socket: permission denied Will try TCP ping Error checking for server status: Get "https://la1.us.backend.librespeed.org/empty.php": dial tcp 185.198.26.89:443: connect: no route to host Server Los Angeles, United States (2) (HostHatch) (la1.us.backend.librespeed.org) doesn't seem to be up, skipping Failed to ping target host: socket: permission denied Will try TCP ping Error checking for server status: Get "https://il1.us.backend.librespeed.org/empty.php": context deadline exceeded (Client.Timeout exceeded while awaiting headers) Server Chicago, United States (HostHatch) (il1.us.backend.librespeed.org) doesn't seem to be up, skipping Failed to ping target host: socket: permission denied Will try TCP ping --> hangs here