Skip to content
Snippets Groups Projects
Commit cc82abbd authored by Stan Hu's avatar Stan Hu
Browse files

Free open file descriptors and libgit2 buffers in UpdatePagesService

In UpdatePagesService, we were seeing a large number of open pack files in
production. Calling Project#cleanup removes a reference to Rugged::Repository
and forces libgit2 to close file descriptors and free its internal memory
cache.

Relates to https://gitlab.com/gitlab-com/infrastructure/issues/3965#note_65837525
parent 9b76d851
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -178,6 +178,9 @@ module Projects
 
def latest_sha
project.commit(build.ref).try(:sha).to_s
ensure
# Close any file descriptors that were opened and free libgit2 buffers
project.cleanup
end
 
def sha
Loading
Loading
---
title: Free open file descriptors and libgit2 buffers in UpdatePagesService
merge_request:
author:
type: performance
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment