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

Bleve indexer stuck on large repo #20020

Closed
Fogapod opened this issue Jun 18, 2022 · 3 comments
Closed

Bleve indexer stuck on large repo #20020

Fogapod opened this issue Jun 18, 2022 · 3 comments
Labels

Comments

@Fogapod
Copy link
Contributor

Fogapod commented Jun 18, 2022

Description

I'm running gitea on weak hardware with just 1 cpu. I got linux kernel mirror to work but code indexing is in a weird state.
Here is what admin ui shows:
image
All other repos have commit shown so indexer works otherwise.

When i add reindexing to queue, multiple processes appear in system and run for a couple minutes, then they disappear. There are no dmesg OOM messages, there are no gitea logs about it. Gitea admin ui still shows them as running:
image

Code search works, at least partially:
image

I have nothing interesting in config:

[indexer]
REPO_INDEXER_ENABLED = true

gitea.com has linux source. I wonder what is the state of indexer there? https://gitea.com/marktsai0316/linux
gitea.com has indexer disabled

Gitea Version

1.17.0+dev-751-g433443ffa built with GNU Make 4.3, go1.18.1 : bindata

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.34.1

Operating System

Ubuntu 22.04 LTS

How are you running Gitea?

Locally compiled binary

Database

PostgreSQL

@Fogapod
Copy link
Contributor Author

Fogapod commented Jun 18, 2022

Clicking trash icon does nothing:

Jun 18 17:04:15 localhost gitea[62335]: 2022/06/18 17:04:15 [62ae058f] router: completed POST /admin/monitor/cancel/62adf91d-2 for [::]:0, 200 OK in 3.9ms @ admin/admin.go:358(admin.MonitorCancel)
Jun 18 17:04:15 localhost gitea[62335]: 2022/06/18 17:04:15 [62ae056b] router: completed GET /user/events for [::]:0, 200 OK in 36032.1ms @ events/events.go:19(events.Events)
Jun 18 17:04:15 localhost gitea[62335]: 2022/06/18 17:04:15 [62ae058f-2] router: completed GET /admin/monitor for [::]:0, 200 OK in 25.1ms @ admin/admin.go:326(admin.Monitor)
Jun 18 17:04:19 localhost gitea[62335]: 2022/06/18 17:04:19 [62adf4fd] router: polling   GET /user/events for [::]:0, elapsed 3439.0ms @ events/events.go:19(events.Events)

@wxiaoguang
Copy link
Contributor

It's highly likely related to this problem, but there is no clue about how to fix it.

for _, indexerData := range items {
log.Trace("IndexerData Process Repo: %d", indexerData.RepoID)
// FIXME: it seems there is a bug in `CatFileBatch` or `nio.Pipe`, which will cause the process to hang forever in rare cases
/*
sync.(*Cond).Wait(cond.go:70)
github.com/djherbis/nio/v3.(*PipeReader).Read(sync.go:106)
bufio.(*Reader).fill(bufio.go:106)
bufio.(*Reader).ReadSlice(bufio.go:372)
bufio.(*Reader).collectFragments(bufio.go:447)
bufio.(*Reader).ReadString(bufio.go:494)
code.gitea.io/gitea/modules/git.ReadBatchLine(batch_reader.go:149)
code.gitea.io/gitea/modules/indexer/code.(*BleveIndexer).addUpdate(bleve.go:214)
code.gitea.io/gitea/modules/indexer/code.(*BleveIndexer).Index(bleve.go:296)
code.gitea.io/gitea/modules/indexer/code.(*wrappedIndexer).Index(wrapped.go:74)
code.gitea.io/gitea/modules/indexer/code.index(indexer.go:105)
*/
if err := index(ctx, indexer, indexerData.RepoID); err != nil {

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 21, 2023

It should have been fixed, related to #26325, more details in #26967

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants