This makes it easier to specify several adapters, with varying
configurations, by not having to put the configuration for each
specification in a separate file.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Oops. Brown paper bag moment.
This undoes the type mangling to ensure the field value is never zero,
in favor of doing run time logic. That should be done with types some
day, but today I need to get running.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
I didn't like having asserts, and didn't want debug_asserts. With
plain asserts, the program would have panicked. With debug_asserts, the
program would have silently overwritten the item in the queue.
Instead, change the method to return whether it was able to set, and
have the caller cope with not being able to set. The caller needs to
be able handle that (and was already doing so).
Found-by: Fintan
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Feed child process stdin via a temporary file. This is simpler than
opening a pipe and spawning a thread that feeds the pipe, when it's
not full.
Capture child stderr into a buffer without trying to let the
caller (another thread) process it line by line. We don't seem to have
use for that, and this simplifies things a fair bit.
Simplify the capture of child stdout to use a simpler thread and data
structure, compared to the previous multi-thread setup. Splitting
stdout into lines is now done by the thread that consumes the lines,
making the code that captures it simpler.
Also update the timeout subcommand to work with the changes. Other
callers of this code aren't yet updated.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This will be useful for inter-thread synchronization in situations
where the producer thread should not produce anything until at least
one consumer is ready for it.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This doesn't yet affect anything, but it's a step towards implementing
concurrent adapters. The default is 1, which will be no change from
previous behavior, once I add support.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Make TagName into a new type (struct), instead of a type alias for
RefString. This provide stronger type safety, for the cost of a little
more implementation work. For the needs of the CI broker, that's two
methods and two trait impls.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
We need to parse the run info in the database as JSON to get at the
adapter run info. This fails if the run info can't be parsed. That can
happen if the database has run info from a development version. Change
`cibtool run remove` so that it takes only broker run ids by default
so that we can delete using those even if the run info is broken.
Allow removing by adapter run id with the `--adapter` option.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
If the run info can't be parsed as JSON, loading it will fail. Change
`cibtool run list` so that it only lists the run ids by default.
Signed-off-by: Lars Wirzenius <liw@liw.fi>