mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Clemmer <>
Subject Re: Review Request 46928: Added safety fixes to and tests `os::close`.
Date Tue, 10 May 2016 08:15:01 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated May 10, 2016, 8:15 a.m.)

Review request for mesos, Daniel Pravat, Artem Harutyunyan, Joris Van Remoortere, and Michael

Bugs: MESOS-5318

Repository: mesos


This commit has three goals:

  (1) Expand the `os::close` to support closing Windows `HANDLE`
      objects. This will simplify code in many places, but most notably
      (and immediately) subprocess, where sharing code between POSIX and
      Windows implementations is a major priority.
  (2) Make `os::close` safe on Windows. Unlike its POSIX cousins, the
      Windows implementation of `::close` is very picky about which file
      descriptors it will close. If you pass it a `SOCKET` by mistake,
      for example, the C runtime will throw a structured exception.
      Since this could potentially halt the process, and since our core
      socket abstractions (socket.hpp, for example) use `int` to
      represent sockets, it is worth investing in safety here.
  (3) Add `os::close` unit tests to verify the safety requirements.

Diffs (updated)

  3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/close.hpp 8f7318aecff261b803991f7aa24ad869de8c1162

  3rdparty/libprocess/3rdparty/stout/tests/main.cpp 3f3f62769abdbe44b3e37e0ea9e5f59484b52db6

  3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp 269079f316b51e19990d3058c1b9a34060e3559b




Alex Clemmer

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message