Commit 0d424c42 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 c9d928b95637
......@@ -178,6 +178,9 @@ def delete_artifact!
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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment