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

pkhuong / kismet-cache / 6207687088 / 1
99%
main: 99%

Build:
DEFAULT BRANCH: main
Ran 16 Sep 2023 01:35PM UTC
Files 10
Run time 0s
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

16 Sep 2023 01:33PM UTC coverage: 98.852% (-0.02%) from 98.869%
6207687088.1

push

github

pkhuong
stack: check close(2) before publishing NamedTempFile to cache

Close *can* fail for real I/O reasons, and while it would be ideal
to always fsync:

1. that's an (opt-out) option
2. it can still be nice to detect post-fsync failures
3. with NFS close-to-open consistency, closing is the most reliable
   way to make the file's contents globally visible.

In general, Kismet works on paths, not files, so there's not much
we can do about closing (or not) the underlying File object before
publishing it.

For `NamedTempFile`s though, we get both a file and a path!  We can
extract the file, make sure it's ready for publication (world readable,
fsync-ed if necessary, and then closed) before passing the `TempPath`
to Kismet's usual path-based machinery.

This `TempPath` is what keeps the temporary file path alive, so everything
will still be cleaned up on error, even though the file descriptor
itself is long gone.

Of course, Rust doesn't yet have an `Error`-ful `File::close`, so we
roll our own with libc...

3703 of 3746 relevant lines covered (98.85%)

346.35 hits per line

Source Files on job 6207687088.1
  • Tree
  • List 0
  • Changed 7
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 6207687088
  • eecff358 on github
  • Prev Job for on main (#6134500243.1)
  • Next Job for on main (#6461524775.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc