#5488 Feature request: Make directory used by tempfile.mkdtemp configurable
Opened 8 months ago by wombelix. Modified 7 months ago

There are two places where a temp directory is created to perform git clone operations:

https://pagure.io/pagure/blob/master/f/pagure/lib/git.py#_977
https://pagure.io/pagure/blob/master/f/pagure/lib/git.py#_2892

The are not configurable and default to the systems /tmp folder.
Risk is that a large fork or mirror operating fills up the root disk if the global temp folder isn't on a separate partition.
We should introduce a new config parameter and if it's set we pass that path to tempfile.mkdtemp() as additional parameter.


There are two places where a temp directory is created to perform git clone operations:

https://pagure.io/pagure/blob/master/f/pagure/lib/git.py#_977
https://pagure.io/pagure/blob/master/f/pagure/lib/git.py#_2892

The are not configurable and default to the systems /tmp folder.
Risk is that a large fork or mirror operating fills up the root disk if the global temp folder isn't on a separate partition.
We should introduce a new config parameter and if it's set we pass that path to tempfile.mkdtemp() as additional parameter.

This is already configurable via an environment variable (we do this in one of
the two Fedora instances already).

It basically leverage:
https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir

Ah ok, makes sense, I guess then some better documentation around it would be helpful :D

on the code.opensuse.org instance we run into issues today during some tests and forking a repo, that then failed because it was running out of space, left a fork without actual content assigned to my user. So I guess forking should be somehow atomic. If an error occurs down the line it shouldn't created in the database either.

So I guess forking should be somehow atomic. If an error occurs down the line it shouldn't created in the database either.

Yes, we try to do that (iirc) but it's actually kind of tricky considering how
many error can happen (DB level, FS level...). It can surely be improved still
for sure though

Metadata Update from @wombelix:
- Issue untagged with: RFE
- Issue tagged with: doc

8 months ago

Metadata Update from @wombelix:
- Issue tagged with: RFE

8 months ago

Metadata Update from @wombelix:
- Issue tagged with: easyfix

7 months ago

Log in to comment on this ticket.

Metadata