Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/godoc: HTTP server never rechecks index if initial index is invalid #26027
What version of Go are you using (
Interesting scenario. I am curious to know whether you actually encountered this in a real situation (and if so, how), or you would like to see this feature.
The current way seems like the cleanest option to me. I think we should just fail to start if an invalid index file is provided. Starting a server with corrupted state does not seem very right.
Maybe we can expose a handler url to ask the server to re-initialize the index, if a user has updated the index file (but only after the server has initialized with a correct index). Checking it for every query seems unnecessary. A query should just return results from the index, or an error if something went wrong.
Anyway, I don't see a real perf benefit because the server has to re-initialize the index all over again. Just that you don't have to restart the godoc server.