Skip to content

Returning something other than Drv::ByteStreamStatus::OP_OK can cause queue overflow issues #47

@laboratory10

Description

@laboratory10

Drv::ByteStreamStatus StreamDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBuffer) {
return write_data(serBuffer);
}

By passing the return value of write_data back to whatever calls send_handler, it is possible to pass Drv::ByteStreamStatus::OP_OK or Drv::ByteStreamStatus::OTHER_ERROR. When other error is returned for me (in my case it is returned because my board tries to write data to serial but I haven't yet connected my computer to read the serial buffer), I quickly see an overflow in ComQueue with the WARNING_HI EVR QueueOverflow and all downlink stops entirely:

EVENT: (512) (2:4,298807) WARNING_HI: QueueOverflow : The COM_QUEUE (0) queue at index 1 overflowed

I'm currently addressing this by simply writing the data and returning OP_OK (which is essentially what you had before the v4 updates)

Drv::ByteStreamStatus StreamDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBuffer) {
    (void) write_data(serBuffer);
    return Drv::ByteStreamStatus::OP_OK;
}

I understand not wanting to blindly return an OK status even if the write wasn't successful. If that doesn't sit well with you maybe you could try another option? Either finding a way to clear the queue even when the write isn't successful or maybe something like:

Drv::ByteStreamStatus StreamDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBuffer) {
    Drv::ByteStreamStatus status =  write_data(serBuffer);
    if (status !=  Drv::ByteStreamStatus::OP_OK) {
        //issue a warning EVR?
    }
    return Drv::ByteStreamStatus::OP_OK;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions