You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uploads an image without chewing through at least (imageSize * 2) worth of memory. Chewing up more than 1G is probably unreasonable regardless of incoming filesize. Imagine uploading a Windows qcow 😄 while it eats windows qcow * 2 memory doing it.
Actual Behavior
SIGSEGV; Fails to upload because we read the entire file into memory, then we clone that into a new buffer.... THEN we pass it to net/http. double buffering. mmmmmm
Steps to Reproduce
terraform apply where image size > mem+swap allocated to machine
Important Factors
*os.File implements io.reader which is what net/http is looking for, so if the only reason we're reading the entire file to spawn a new buffer is to satisfy the net/http NewRequest format... that's not necessary
Here's an example where I do the same thing against the same Foundation API endpoint, but I'm simply using base go libraries and passing the file ptr to http.Post:
^ the above code is stupid simple, but I've profiled both and actually streaming as shown in the example above never went above like .4% memory usage, compared to balloon -> balloon -> balloon -> crash. and as you can see, the file uploaded successfully.
The text was updated successfully, but these errors were encountered:
Nutanix Cluster Information
Foundation 5.1.1
This would also apply to any cluster or PC version as it has nothing to do with any of these
Terraform Version
[wwhitt@phx-se-automation-dev-1 test]$ terraform -v
Affected Resource(s)
Terraform Configuration Files
Panic Output
Expected Behavior
It uploads an image without chewing through at least (imageSize * 2) worth of memory. Chewing up more than 1G is probably unreasonable regardless of incoming filesize. Imagine uploading a Windows qcow 😄 while it eats windows qcow * 2 memory doing it.
Actual Behavior
SIGSEGV; Fails to upload because we read the entire file into memory, then we clone that into a new buffer.... THEN we pass it to net/http. double buffering. mmmmmm
Steps to Reproduce
terraform apply
where image size > mem+swap allocated to machineImportant Factors
*os.File implements io.reader which is what net/http is looking for, so if the only reason we're reading the entire file to spawn a new buffer is to satisfy the net/http NewRequest format... that's not necessary
Here's an example where I do the same thing against the same Foundation API endpoint, but I'm simply using base go libraries and passing the file ptr to http.Post:
^ the above code is stupid simple, but I've profiled both and actually streaming as shown in the example above never went above like .4% memory usage, compared to balloon -> balloon -> balloon -> crash. and as you can see, the file uploaded successfully.
The text was updated successfully, but these errors were encountered: