Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drv/Ip/TcpClientSocket.cpp prints errors when intentionally not connected. #1442

Closed
timcanham opened this issue May 10, 2022 · 5 comments
Closed
Assignees
Labels
enhancement High Priority High Priority issue that needs to be resolved.

Comments

@timcanham
Copy link
Collaborator

timcanham commented May 10, 2022

F´ Version 3.0.0
Affected Component `Drv/Ip/TcpClientSocket.cpp

Problem Description

A description of the problem with sufficient detail to understand the issue.

How to Reproduce

  1. Start deployment with no host/port
  2. Look at stdout
  3. You will see endlessly repeated:
[ERROR] Failed to send framed data: 0
[ERROR] Failed to send framed data: 0
[ERROR] Failed to send framed data: 0

Expected Behavior

If the socket has not been configured, this call should return SEND_OK:

Drv::SendStatus TcpClientComponentImpl::send_handler(const NATIVE_INT_TYPE portNum, Fw::Buffer& fwBuffer) {
    Drv::SocketIpStatus status = m_socket.send(fwBuffer.getData(), fwBuffer.getSize());
    // Always return the buffer
    deallocate_out(0, fwBuffer);
    if ((status == SOCK_DISCONNECTED) || (status == SOCK_INTERRUPTED_TRY_AGAIN)) {
        return SendStatus::SEND_RETRY;
    } else if (status != SOCK_SUCCESS) {
        return SendStatus::SEND_ERROR;
    }
    return SendStatus::SEND_OK;
}

Specifically, this call is printing the message based on the above error code:

void FramerComponentImpl ::send(Fw::Buffer& outgoing) {
    Drv::SendStatus sendStatus = framedOut_out(0, outgoing);
    if (sendStatus.e != Drv::SendStatus::SEND_OK) {
        // Note: if there is a data sending problem, an EVR likely wouldn't make it down. Log the issue in hopes that
        // someone will see it.
        Fw::Logger::logMsg("[ERROR] Failed to send framed data: %d\n", sendStatus.e);
    }
}
@timcanham timcanham added the bug label May 10, 2022
@LeStarch
Copy link
Collaborator

We should set this up to log once, and then only log again when it transitions from OK to error again.

@LeStarch
Copy link
Collaborator

@timcanham with the addition of the ComQueue component to Ref this is now fixed. Data queues up and you get a minimal set of EVRs indicating overflow. The incessant printing now only happens if you choose to skip the ComQueue/ComStub pairing.

Can we close or is there more we want to discuss here?

@timcanham
Copy link
Collaborator Author

Are the overflow events for the ComQueue throttled? If not, will it do the same thing eventually?

@LeStarch
Copy link
Collaborator

@timcanham yes it is throttled. Is this sufficient?

@LeStarch LeStarch added enhancement and removed bug labels Nov 29, 2023
@LeStarch LeStarch added the High Priority High Priority issue that needs to be resolved. label Mar 27, 2024
@thomas-bc
Copy link
Collaborator

Fixed in #2950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement High Priority High Priority issue that needs to be resolved.
Projects
None yet
Development

No branches or pull requests

3 participants