提交 cc82abbd 编写于 作者: S Stan Hu

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
上级 9b76d851
......@@ -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
......
---
title: Free open file descriptors and libgit2 buffers in UpdatePagesService
merge_request:
author:
type: performance
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册