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
x/tools/cmd/godoc: start server before scanning $GOPATH #13278
Comments
On my laptop, the server finishes starting faster than I can switch to a browser window and press return. Maybe there is another issue here? |
It depends how big your workspace is. Sometimes it can take a few seconds
to spin up. I think this is a reasonable request.
|
Is this not not covered by the -v flag?
There are a couple function calls between these logs and http.ListenAndServe, but they are in new goroutines. |
@jnjackins I guess there you misunderstood what I asked, i do not want to know each and every thing as in the -v flag, I just want to know when the server has started! just one line, |
I don't think godoc shoud print chatter unless asked (with -v). But it would be reasonable for godoc to start the server before scanning the entire $GOPATH. Then at least you can go to the page and get a "we're still indexing" or whatever the status is. |
Change https://golang.org/cl/55930 mentions this issue: |
Change https://golang.org/cl/83975 mentions this issue: |
Looks like both the CLs were abandoned. I have a CL prepared which returns a proper message before the scan is complete, so that the webserver is responsive and the scan can continue in the background. Will send it across shortly. |
Change https://golang.org/cl/88695 mentions this issue: |
Reverted in golang.org/cl/93115 |
Oops, so sorry about this. I can't remember why I did not run the tests. My bad. Anyways, so the I will send a CL with the proper fix. On a side note, should we start running tests in try bots for this repo ? |
Trybots need to be kicked off by a human. They just weren't kicked off. |
Change https://golang.org/cl/93215 mentions this issue: |
Change https://golang.org/cl/102799 mentions this issue: |
… http mode Currently, in http mode the server blocks until the corpus has been initialized. This can cause considerable delay if the user workspace is significantly large and the files are not present in the buffer cache. This CL spawns off the initialization in a separate goroutine if httpMode is set and turns on a flag when it's done. The http handler checks the flag and returns an error response if it has not been set. The check is only performed for the path prefixes handled by the handlerServer struct. Other paths do not call the GetPageInfo() function and hence can return immediately. This preserves maximum responsiveness of the server. Also adds an additional print statement in verbose mode Note: This is a re-do of a previous CL golang.org/cl/88695 which was incorrect committed without running tests. This CL fixes that test. Fixes golang/go#13278 Change-Id: I80c801f32af007312090d3783a2ea2c6f92cad66 Reviewed-on: https://go-review.googlesource.com/93215 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 006ac43) Reviewed-on: https://go-review.googlesource.com/102799 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
When we run godoc, it doesn't show any notification that the server has started, typically when I need godoc up and running I am in a middle of a programming crisis and only the doc can save me, but sadly it doesn't print when it is ready, I have to wait for some time or keep refreshing the page in my browser 100 times before it actually is started. So it would be great if we print this message before the call to HandleAndServe function, a way to notify that the server is up and running
The text was updated successfully, but these errors were encountered: