• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xapi-project / xen-api / 45122568883
79%
master: 79%

Build:
Build:
LAST BUILD BRANCH: CP-314185-typed-card-order
DEFAULT BRANCH: master
Ran 23 Nov 2026 06:13AM UTC
Jobs 1
Files 36
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Nov 2026 06:12AM UTC coverage: 78.996%. Remained the same
45122568883

push

github

web-flow
CA-432853: drain the metadata import body, counting pax headers correctly (#7400)

`PUT /import_metadata` reads the tar header, `ova.xml` and its zero
padding, then skips two end-of-archive blocks. The record padding after
them stays on the socket. If the server closes the connection while the
client still sends that padding, the client gets EPIPE.

An earlier fix drained the rest of the body with Content-Length, but it
assumed that the tar header is always one 512-byte block. A pax archive,
for example one written by Python `tarfile`, has an extended-header
record before the ustar header. The drain then asked for more bytes than
the client sent, and the import blocked. That fix was reverted in
29f54fc01.

## Changes

1. Replace `BufferOrFile` with `Tar_helpers.probe_header`.
The function reads the first block, gives it to `Tar.HeaderReader` from
memory, and returns `Header {hdr; bytes_read}` or `Not_tar first_block`.
`bytes_read` is the real number of header bytes taken off the fd,
including a pax extended-header record. The first block decides the
format: a parse failure inside it means the stream is not tar, and a
failure after it raises. The reader state is hidden by
`tar_helpers.mli`. The decompression path does not change.

2. Drain the rest of the body in `metadata_handler`.
With Content-Length, consume `Content-Length - (bytes_read + ova.xml
size + zero padding)`. Without Content-Length, skip the two
end-of-archive blocks, as before. The drain runs before the import, so a
short body fails the request before any object is created, and the body
is consumed even when the import raises. Only the uncompressed path
drains. On the compressed path, the feeder thread already reads the
whole body.

3. Add unit tests for `Tar_helpers.probe_header` in `ocaml/xapi-aux`.

3667 of 4642 relevant lines covered (79.0%)

0.79 hits per line

Jobs
ID Job ID Ran Files Coverage
1 python3.11 - 45122568883.1 23 Nov 2026 06:13AM UTC 36
79.0
GitHub Action Run
Source Files on build 45122568883
  • Tree
  • List 36
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #45122568883
  • 39132685 on github
  • Prev Build on gh-readonly-queue/master/pr-7355-4641f47c899d0cfafc8a2fa6f585ecc55f3532a7 (#45096088516)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc