Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
gitserver: close packed-refs file in quickRevParseHead() (#4026)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijt authored May 16, 2019
1 parent c893ed3 commit 3e65372
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ All notable changes to Sourcegraph are documented in this file.
- Fixed a bug where browser extension and code review integration usage stats were not being captured on the site-admin Usage Stats page.
- Fixed an issue where in some rare cases PostgreSQL starting up slowly could incorrectly trigger a panic in the `frontend` service.
- Fixed an issue where the management console password would incorrectly reset to a new secure one after a user account was created.
- Fixed a bug where gitserver would leak file descriptors when performing common operations.
- Substantially improved the performance of updating external service configurations on instances with thousands of repositories, going from e.g. several minutes to about a minute for ~20k repositories.
- Fully resolved the search performance regression in v3.2.0, restoring performance of search back to the same levels it was before changes made in v3.2.0.

Expand Down
5 changes: 3 additions & 2 deletions cmd/gitserver/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"syscall"
"time"

opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
otlog "github.com/opentracing/opentracing-go/log"
"github.com/pkg/errors"
Expand All @@ -40,7 +40,7 @@ import (
"github.com/sourcegraph/sourcegraph/pkg/repotrackutil"
"github.com/sourcegraph/sourcegraph/pkg/trace"
"github.com/sourcegraph/sourcegraph/pkg/vcs/git"
log15 "gopkg.in/inconshreveable/log15.v2"
"gopkg.in/inconshreveable/log15.v2"
)

// tempDirName is the name used for the temporary directory under ReposDir.
Expand Down Expand Up @@ -1312,6 +1312,7 @@ func quickRevParseHead(dir string) (string, error) {
if err != nil {
return "", err
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
fields := bytes.Fields(scanner.Bytes())
Expand Down

0 comments on commit 3e65372

Please sign in to comment.