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
This commit is contained in:
parent
9b76d8512a
commit
cc82abbde0
|
@ -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
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Free open file descriptors and libgit2 buffers in UpdatePagesService
|
||||
merge_request:
|
||||
author:
|
||||
type: performance
|
Loading…
Reference in New Issue