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

x/tools/cmd/godoc: url flag races against index creation #30260

Closed
rhysh opened this issue Feb 15, 2019 · 2 comments
Closed

x/tools/cmd/godoc: url flag races against index creation #30260

rhysh opened this issue Feb 15, 2019 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rhysh
Copy link
Contributor

rhysh commented Feb 15, 2019

What version of Go are you using (go version)?

$ go version
go version devel +701f6a27b5 Mon Feb 11 18:18:45 2019 +0000 darwin/amd64

I'm comparing the x/tools repo at release-branch.go1.11 vs release-branch.go1.12.

Does this issue reproduce with the latest release?

Yes, this is broken in master of the x/tools repo.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rhys/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/rhys/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/49/zmds5zsn75z1283vtzxyfr5hj7yjq4/T/go-build329945537=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go run golang.org/x/tools/cmd/godoc -url=/pkg/fmt -http=""
2019/02/15 10:34:12 HTTP error 404
exit status 1

What did you expect to see?

I expected to see HTML similar to what's served by https://golang.org/pkg/fmt/

What did you see instead?

I got an error message referencing an HTTP 404 code. It appears that the request to satisfy the url flag races against the index creation, so no packages are found.


I have a fix for this, including regression tests. I'll upload it shortly.

@gopherbot gopherbot added this to the Unreleased milestone Feb 15, 2019
@gopherbot
Copy link

Change https://golang.org/cl/162907 mentions this issue: cmd/godoc: fix -url flag, add tests

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 18, 2019
@dmitshur
Copy link
Contributor

dmitshur commented Feb 18, 2019

This is a regression from CL 141397, where the logic for whether to init corpus synchronously was modified. It was partially fixed for writing index mode in CL 141717, but not for url flag mode. It wasn't caught because we didn't have a test for the -url flag yet (we will after your CL, thanks for that).

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 18, 2019
@golang golang locked and limited conversation to collaborators Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants