Commit eec109dc authored by AdamSimpson's avatar AdamSimpson
Browse files

Fix builder output issue with error success

parent 7decb7f9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -60,14 +60,14 @@ int main(int argc, char *argv[]) {
        callback_type read_std_pipe = [&](const boost::system::error_code& ec, std::size_t size) {
            client_messenger.send(buffer);

            if(size > 0 && ec != asio::error::eof) {
            if(size > 0 && ec == boost::system::errc::success) {
                asio::async_read_until(std_pipe, buffer, line_matcher, read_std_pipe);
            }
            else if(size == 0 && ec == asio::error::eof) {
                logger::write("Read 0 bytes and EOF");
                logger::write("build output EOF");
            }
            else {
                logger::write(std::string("Error reading builder output: ") + ec.message());
                throw std::system_error(EBADMSG, std::generic_category(), "Error reading build output" + ec.message());
            }
        };
        // Start reading child stdout/err from pipe
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@

class BuilderQueue {
public:
    explicit BuilderQueue(asio::io_service &io_service) : io_service(io_service) {}
    explicit BuilderQueue(asio::io_service &io_service) : io_service(io_service),
                                                          max_available_builders(1) {}

    // Create a new queue reservation and return it to the requester
    Reservation& enter();
+3 −0
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ int main(int argc, char *argv[]) {
            std::cout << line;
        } while (!line.empty());

        // Receiving file
        std::cout << "Container built!\n";

        // Read the container image
        builder_messenger.receive_file(container_path);