Commit Graph

30 Commits

Author SHA1 Message Date
Nick Ethier
e0a599ed9c nit: code cleanup/organization 2021-04-16 15:14:29 -04:00
Nick Ethier
e834a60de1 plugins/drivers: fix deprecated fields 2021-04-16 14:13:29 -04:00
Nick Ethier
1925f6b893 cgutil: set reserved mems on init even if already exist 2021-04-15 10:24:31 -04:00
Nick Ethier
4a25ec9410 testing fixes 2021-04-14 10:17:28 -04:00
Nick Ethier
355212c30c cgutil: add nil check on AddAlloc 2021-04-13 13:28:36 -04:00
Nick Ethier
f897ac79e8 client/ar: thread through cpuset manager 2021-04-13 13:28:36 -04:00
Nick Ethier
5e7b411dec cgutil: implement cpuset management as seperate package 2021-04-13 13:28:36 -04:00
Nick Ethier
84e44d53d0 Apply suggestions from code review
Co-authored-by: Drew Bailey <drewbailey5@gmail.com>
2021-04-13 13:28:15 -04:00
Nick Ethier
cd8fb2d3e3 cgutil: fix lint errors 2021-04-13 13:28:15 -04:00
Nick Ethier
b8397a712d fingerprint: implement client fingerprinting of reservable cores
on Linux systems this is derived from the configure cpuset cgroup parent (defaults to /nomad)
for non Linux systems and Linux systems where cgroups are not enabled, the client defaults to using all cores
2021-04-13 13:28:15 -04:00
Nick Ethier
dc08ec8783 ar: plumb client config for networking into the network hook 2019-07-31 01:04:06 -04:00
Nick Ethier
e15005bdcb networking: Add new bridge networking mode implementation 2019-07-31 01:04:06 -04:00
Nick Ethier
56d5fe704a ar: rearrange network hook to support building on windows 2019-07-31 01:03:19 -04:00
Danielle Lancashire
c712fdcbd9 fifo: Safer access to Conn 2019-07-02 13:12:54 +02:00
Danielle Lancashire
8148466da6 fifo: Close connections and cleanup lock handling 2019-07-01 14:14:29 +02:00
Danielle Lancashire
aff554deec appveyor: Run logmon tests 2019-06-28 16:01:41 +02:00
Danielle Lancashire
e6daf3b5bd fifo: Require that fifos do not exist for create
Although this operation is safe on linux, it is not safe on Windows when
using the named pipe interface. To provide a ~reasonable common api
abstraction, here we switch to returning File exists errors on the unix
api.
2019-06-28 13:47:18 +02:00
Danielle Lancashire
76f72fe4bd vendor: Use dani fork of go-winio 2019-06-28 13:47:18 +02:00
Danielle Lancashire
efda81cbbb logmon: Refactor fifo access for windows safety
On unix platforms, it is safe to re-open fifo's for reading after the
first creation if the file is already a fifo, however this is not
possible on windows where this triggers a permissions error on the
socket path, as you cannot recreate it.

We can't transparently handle this in the CreateAndRead handle, because
the Access Is Denied error is too generic to reliably be an IO error.
Instead, we add an explict API for opening a reader to an existing FIFO,
and check to see if the fifo already exists inside the calling package
(e.g logmon)
2019-06-28 13:41:54 +02:00
Mahmood Ali
ea2f96e585 tests: fix fifo lib race
Accidentally accessed outer `err` variable inside a goroutine
2019-05-21 09:49:56 -04:00
Mahmood Ali
714c41185c rename fifo methods for clarity 2019-04-01 16:52:58 -04:00
Mahmood Ali
3c68c946c4 no requires in a test goroutine 2019-04-01 15:38:39 -04:00
Mahmood Ali
5ca9b6eb37 fifo: Use plain fifo file in Unix
This PR switches to using plain fifo files instead of golang structs
managed by containerd/fifo library.

The library main benefit is management of opening fifo files.  In Linux,
a reader `open()` request would block until a writer opens the file (and
vice-versa).  The library uses goroutines so that it's the first IO
operation that blocks.

This benefit isn't really useful for us: Given that logmon simply
streams output in a separate process, blocking of opening or first read
is effectively the same.

The library additionally makes further complications for managing state
and tracking read/write permission that seems overhead for our use,
compared to using a file directly.

Looking here, I made the following incidental changes:
* document that we do handle if fifo files are already created, as we
rely on that behavior for logmon restarts
* use type system to lock read vs write: currently, fifo library returns
`io.ReadWriteCloser` even if fifo is opened for writing only!
2019-04-01 13:18:03 -04:00
Nick Ethier
a203689bbc fifo: add new fifo package for named pipes (#4665)
* fifo: add new fifo package for named pipes
2018-10-16 16:53:30 -07:00
Michael Schurter
6858c520b2 framer: fix early exit/truncation in framer 2018-05-02 10:46:16 -07:00
Michael Schurter
361db269c2 framer: fix race and remove unused error var
In the old code `sending` in the `send()` method shared the Data slice's
underlying backing array with its caller. Clearing StreamFrame.Data
didn't break the reference from the sent frame to the StreamFramer's
data slice.
2018-05-02 10:46:16 -07:00
Alex Dadgar
b0d0359b59 clarify force 2018-02-15 13:59:02 -08:00
Alex Dadgar
d77b36698c HTTP and tests 2018-02-15 13:59:02 -08:00
Alex Dadgar
9d479f3d80 test stream framer 2018-02-15 13:59:01 -08:00
Alex Dadgar
5e7a1a44a2 Logs over RPC w/ lots to touch up 2018-02-15 13:59:01 -08:00