Commit a38f9c91 authored by Greg Williams's avatar Greg Williams
Browse files

Added socket file descriptor to PDU brief log messages for easier correlation...

Added socket file descriptor to PDU brief log messages for easier correlation with messages in thread pool.
Fixed system test dependency on client lib so that if a source file in the lib changes, then running a system test will force a rebuild.
Added checking of result of bus_send_request in kinetic_operation so that if a failure occurs when queueing a PDU for send it will be reported out to the client API.
parent 7f44a226
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -295,10 +295,10 @@ systest_names = $(patsubst $(SYSTEST_OUT)/run_%,%,$(systest_executables))
list_system_tests:
	echo $(systest_names)

$(SYSTEST_OUT)/%_runner.c: $(SYSTEST_SRC)/%.c
$(SYSTEST_OUT)/%_runner.c: $(SYSTEST_SRC)/%.c $(KINETIC_LIB)
	./test/support/generate_test_runner.sh $< > $@

$(SYSTEST_OUT)/run_%: $(SYSTEST_SRC)/%.c $(SYSTEST_OUT)/%_runner.c $(KINETIC_LIB)
$(SYSTEST_OUT)/run_%: $(SYSTEST_SRC)/%.c $(SYSTEST_OUT)/%_runner.c
	@echo
	@echo ================================================================================
	@echo System test: '$<'
+4 −4
Original line number Diff line number Diff line
@@ -198,8 +198,8 @@ void KineticController_HandleUnexecpectedResponse(void *msg,
            response->command->header->has_connectionID)
        {
            LOGF1("[PDU RX UNSOLICITED] pdu: 0x%0llX, session: 0x%llX, bus: 0x%llX, "
                "protoLen: %u, valueLen: %u",
                response, &connection->session, connection->messageBus,
                "fd: %6d, protoLen: %u, valueLen: %u",
                response, &connection->session, connection->messageBus, connection->socket,
                response->header.protobufLength, response->header.valueLength);

            // Extract connectionID from unsolicited status message
@@ -240,9 +240,9 @@ void KineticController_HandleExpectedResponse(bus_msg_result_t *res, void *udata
            status = KINETIC_STATUS_INVALID;
        }

        LOGF1("[PDU RX] pdu: 0x%0llX, op: 0x%llX, session: 0x%llX, bus: 0x%llX, "
        LOGF1("[PDU RX] pdu: 0x%0llX, op: 0x%llX, session: 0x%llX, bus: 0x%llX, fd: %6d, "
            "seq: %5lld, protoLen: %4u, valueLen: %u, status: %s",
            response, op, &op->connection->session, op->connection->messageBus,
            response, op, &op->connection->session, op->connection->messageBus, op->connection->socket, 
            response->command->header->ackSequence, response->header.protobufLength, response->header.valueLength,
            Kinetic_GetStatusDescription(status));
    }
+13 −6
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ KineticStatus KineticOperation_SendRequest(KineticOperation* const operation)
// TODO: Asses refactoring this methog by disecting out Operation and relocate to kinetic_pdu
static KineticStatus KineticOperation_SendRequestInner(KineticOperation* const operation)
{
    LOGF3("\nSending PDU via fd=%d", operation->connection->messageBus);
    LOGF3("\nSending PDU via fd=%d", operation->connection->socket);

    KineticStatus status = KINETIC_STATUS_INVALID;
    uint8_t * msg = NULL;
@@ -133,9 +133,9 @@ static KineticStatus KineticOperation_SendRequestInner(KineticOperation* const o
    // Populate sequence count and increment it for next operation
    request->message.header.sequence = operation->connection->sequence++;

    LOGF1("[PDU TX] pdu: 0x%0llX, op: 0x%llX, session: 0x%llX, bus: 0x%llX, seq: %5lld, protoLen: %4u, valueLen: %u",
    LOGF1("[PDU TX] pdu: 0x%0llX, op: 0x%llX, session: 0x%llX, bus: 0x%llX, fd: %6d, seq: %5lld, protoLen: %4u, valueLen: %u",
        operation->request, operation, &operation->connection->session, operation->connection->messageBus,
        request->message.header.sequence, header.protobufLength, header.valueLength);
        operation->connection->socket, request->message.header.sequence, header.protobufLength, header.valueLength);

    KineticLogger_LogHeader(3, &header);

@@ -172,7 +172,7 @@ static KineticStatus KineticOperation_SendRequestInner(KineticOperation* const o
    }
    assert((PDU_HEADER_LEN + header.protobufLength + header.valueLength) == offset);

    bus_send_request(operation->connection->messageBus, &(bus_user_msg){
    if (!bus_send_request(operation->connection->messageBus, &(bus_user_msg){
        .fd       = operation->connection->socket,
        .type     = BUS_SOCKET_PLAIN,
        .seq_id   = request->message.header.sequence,
@@ -180,9 +180,16 @@ static KineticStatus KineticOperation_SendRequestInner(KineticOperation* const o
        .msg_size = offset,
        .cb       = KineticController_HandleExpectedResponse,
        .udata    = operation,
    });

        }))
    {
        LOGF0("Failed queuing request %p for transmit on fd=%d w/seq=%lld",
            (void*)request, operation->connection->socket, (long long)request->message.header.sequence);
        status = KINETIC_STATUS_SOCKET_ERROR;
    }
    else {
        status = KINETIC_STATUS_SUCCESS;
    }


cleanup:

+0 −4
Original line number Diff line number Diff line
@@ -63,10 +63,6 @@ void SystemTestSetup(SystemTestFixture* fixture, int log_level)
        fixture->testIgnored = false;
    }

    // Erase the drive
    status = KineticClient_InstantSecureErase(&fixture->session);
    TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status);

    // TEST_ASSERT_EQUAL_MESSAGE(
    //     fixture->expectedSequence,
    //     fixture->connection.sequence,
+0 −2
Original line number Diff line number Diff line
@@ -73,8 +73,6 @@ void run_throghput_tests(size_t num_ops, size_t value_size)
    uint8_t tag_data[] = {0x00, 0x01, 0x02, 0x03};
    ByteBuffer tag = ByteBuffer_Create(tag_data, sizeof(tag_data), sizeof(tag_data));



    uint32_t keys[num_ops];
    KineticEntry entries[num_ops];