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

AWS tunnel: messages sent very quickly not handled #649

Closed
grinaudo opened this issue Nov 7, 2023 · 8 comments
Closed

AWS tunnel: messages sent very quickly not handled #649

grinaudo opened this issue Nov 7, 2023 · 8 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@grinaudo
Copy link

grinaudo commented Nov 7, 2023

Describe the bug

By sending more than one messages using the member function Aws::Iotsecuretunneling::SecureTunnel::SendMessage in a very short time the messages are not actually sent.
Neither the OnSendMessageComplete registered with Aws::Iotsecuretunneling::SecureTunnelBuilder::WithOnMessageReceived is raised for all messages nor all the messages are received from the other side of the tunnel.

Out of 10 messages sent consecutively only 2 to 5 are actually sent.

Expected Behavior

I think the event registered in Aws::Iotsecuretunneling::SecureTunnelBuilder::WithOnMessageReceived should be invoked for each sent message and the other side of the tunnel should receive all messages sent regardless of the sending timing.

Current Behavior

By sending 10 messages consecutively only for the first 2 or 3 (sometimes up to 5) the OnSendMessageComplete event is raised.
Possibly after 15 seconds (and every 15-20 seconds) another OnSendMessageComplete is raised.

The problem becomes much less frequent by adding a 1 ms sleep between SendMessage calls.

Reproduction Steps

main.zip

Possible Solution

No response

Additional Information/Context

In the attached file you can find two tunnels creation (through the function create_secure_tunnel) and a loop of 10 SendMessage in the main function.
I also tried with different message size but it seems to have no effect on the problem.
I am using a machine with 16 cores so the event loop groups size should be set to 8. I also tried on a device with 1 core (event loop group size set to 1) but it also have no effect.

SDK version used

I tried with 1.30.0 and 1.30.1

Environment details (OS name and version, etc.)

Win10 (Visual Studio 2022 19.37.32822 for x64), Ubuntu 20.04 (g++ 9.4)

@grinaudo grinaudo added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2023
@grinaudo grinaudo changed the title AWS tunnel: messages sent very quickly are not handled in a reasonable time. AWS tunnel: messages sent very quickly not handled Nov 7, 2023
@jmklix
Copy link
Member

jmklix commented Nov 7, 2023

Can you upload your repro-example not in a zip file?

@jmklix jmklix self-assigned this Nov 7, 2023
@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2023
@grinaudo
Copy link
Author

grinaudo commented Nov 7, 2023

I am not sure I understand. Is it ok a gz file? The content is just the source code file.
I compiled it using an integrated system (I made a conan package of the aws sdk on our internal server and I am using cmake) but I think you can just substitute the main.cpp in your secure tunnel samples ( https://github.com/aws/aws-iot-device-sdk-cpp-v2/blob/main/samples/secure_tunneling/secure_tunnel/main.cpp ) and it should compile.

main.cpp.gz

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Nov 7, 2023
@jmklix
Copy link
Member

jmklix commented Nov 7, 2023

Any type of zip file is not preferred, as they can contain malware or other malicious files. Could you possibly post just the plain cpp files on this issue?

@grinaudo
Copy link
Author

grinaudo commented Nov 7, 2023

The github web application does not allow me to upload a file with a cpp extension.
I just added the extension .txt to the file name. Please just rename it and let me know.
main.cpp.txt

@sfod
Copy link
Contributor

sfod commented Nov 8, 2023

Thanks for example, I managed to reproduce the issue. The example looks OK at first glance, so probably something is happening in the internals of secure tunnel. This will require some time to dig.

@sfod
Copy link
Contributor

sfod commented Nov 10, 2023

The issue is fixed in the latest release: https://github.com/aws/aws-iot-device-sdk-cpp-v2/releases/tag/v1.30.2

@grinaudo
Copy link
Author

Thank you!

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants