Please disable pprof HTTP listener of vendored TiDB #1393

Closed
opened 2025-11-02 03:59:12 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @fawick on GitHub (Dec 20, 2017).

/cc @tboerger @lunny

  • Gitea version (or commit ref):
    v1.3.2 (and still in master)
  • Git version:
    git version 2.15.1 (not relevant)
  • Operating system:
    linux/amd64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    Not relevant

Description

The vendored github.com/pingcap/tidb package sets up a own HTTP listener at localhost:8888. (see bdf1856011/vendor/github.com/pingcap/tidb/tidb.go (L293-L295)).

Mind you, the variable in the quoted code lines is a different EnablePprof than github.com/go-gitea/gitea/modules/settings.EnablePprof!

I'd suggest to either combine the PPROF instances of TiDB and Gitea, or disable the TiDB one completely by setting github.com/pingcap/tidb.EnablePprof to false.
(EDIT: That's not going work, as the lines in question are run during tidb package initialization, already.)

Screenshots

(no screenshots)

Originally created by @fawick on GitHub (Dec 20, 2017). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> /cc @tboerger @lunny - Gitea version (or commit ref): v1.3.2 (and still in master) - Git version: git version 2.15.1 (not relevant) - Operating system: linux/amd64 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: Not relevant ## Description The vendored `github.com/pingcap/tidb` package sets up a own HTTP listener at localhost:8888. (see https://github.com/go-gitea/gitea/blob/bdf18560110ac642c196054be38729760a4bbc39/vendor/github.com/pingcap/tidb/tidb.go#L293-L295). Mind you, the variable in the quoted code lines is a different `EnablePprof` than `github.com/go-gitea/gitea/modules/settings.EnablePprof`! ~~I'd suggest to either combine the PPROF instances of TiDB and Gitea, or disable the TiDB one completely by setting `github.com/pingcap/tidb.EnablePprof` to `false`.~~ **(EDIT: That's not going work, as the lines in question are run during `tidb` package initialization, already.)** ## Screenshots (no screenshots) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/enhancement label 2025-11-02 03:59:12 -06:00
Author
Owner

@fawick commented on GitHub (Dec 20, 2017):

For other Gitea users: For the currently vendored version of TiDB, set TIDB_PPROF=0 in your gitea environment to prevent the additional HTTP listener on localhost:8888 from being opened.

@fawick commented on GitHub (Dec 20, 2017): For other Gitea users: For the currently vendored version of TiDB, set `TIDB_PPROF=0` in your gitea environment to prevent the additional HTTP listener on `localhost:8888` from being opened.
Author
Owner

@tboerger commented on GitHub (Dec 20, 2017):

This should be handled by TiDB, it's pretty crappy that they enable it by default...

@tboerger commented on GitHub (Dec 20, 2017): This should be handled by TiDB, it's pretty crappy that they enable it by default...
Author
Owner

@fawick commented on GitHub (Dec 20, 2017):

It was handled by TiDB. The version vendored in Gitea does not have those changes, yet.

@fawick commented on GitHub (Dec 20, 2017): It was handled by TiDB. The version vendored in Gitea does not have those changes, yet.
Author
Owner

@fawick commented on GitHub (Dec 20, 2017):

@tboerger: TiDB handled it in this PR: https://github.com/pingcap/tidb/pull/1541

That PR is older than the commit that added TiDB to Gitea (via go-xorm, I guess.)

@fawick commented on GitHub (Dec 20, 2017): @tboerger: TiDB handled it in this PR: https://github.com/pingcap/tidb/pull/1541 That PR is older than the commit that added TiDB to Gitea (via go-xorm, I guess.)
Author
Owner

@lunny commented on GitHub (Dec 20, 2017):

Maybe we need to update tidb vendor

@lunny commented on GitHub (Dec 20, 2017): Maybe we need to update tidb vendor
Author
Owner

@tboerger commented on GitHub (Dec 20, 2017):

Than some maintainer should update the dependencies.

@tboerger commented on GitHub (Dec 20, 2017): Than some maintainer should update the dependencies.
Author
Owner

@techknowlogick commented on GitHub (Sep 10, 2018):

tidb now removed. Closing this issue.

@techknowlogick commented on GitHub (Sep 10, 2018): tidb now removed. Closing this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1393