Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163846
D6550.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6550.diff
View Options
diff --git a/swh/loader/git/loader.py b/swh/loader/git/loader.py
--- a/swh/loader/git/loader.py
+++ b/swh/loader/git/loader.py
@@ -183,15 +183,6 @@
size_limit = self.pack_size_bytes
def do_pack(data: bytes) -> None:
- cur_size = pack_buffer.tell()
- would_write = len(data)
- if cur_size + would_write > size_limit:
- raise IOError(
- f"Pack file too big for repository {origin_url}, "
- f"limit is {size_limit} bytes, current size is {cur_size}, "
- f"would write {would_write}"
- )
-
pack_buffer.write(data)
pack_result = client.fetch_pack(
@@ -209,7 +200,12 @@
pack_size = pack_buffer.tell()
pack_buffer.seek(0)
- logger.debug("fetched_pack_size=%s", pack_size)
+ logger.info("fetched_pack_size=%s", pack_size)
+ if pack_size > size_limit:
+ raise IOError(
+ f"Pack file too big for repository {origin_url}, "
+ f"limit is {size_limit} bytes, current size is {pack_size}"
+ )
# check if repository only supports git dumb transfer protocol,
# fetched pack file will be empty in that case as dulwich do
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 4:41 PM (2 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225112
Attached To
D6550: wip: Log full pack size and check pack file limit after log instruction
Event Timeline
Log In to Comment