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

Sendmsg Thread Blocking #1814

Closed
wsxjbupt opened this issue Apr 19, 2024 · 3 comments
Closed

Sendmsg Thread Blocking #1814

wsxjbupt opened this issue Apr 19, 2024 · 3 comments

Comments

@wsxjbupt
Copy link

wsxjbupt commented Apr 19, 2024

Describe the bug
Sendmsg Thread Blocking

Expected behavior
normal running.

Actual Behavior
Use the pair_0 protocol for communication, Occasional Sendmsg Thread Block on function nng_aio_wait,Check the call stack information. Everything is normal, pair0_sock->wmq is full, sendmsg thread block on funciton nng_aio_wait,all nng_task is idle.
After receiving the message from the peer end, everything returns to normal.

To Reproduce
If possible include actual reproduction test code here.
Minimal C test cases are perferred.

** Environment Details **

  • 1.5.2
  • aarch64
  • open euler
  • shared lib

Additional context
Add any other context about the problem here.

@gdamore
Copy link
Contributor

gdamore commented Jun 1, 2024

Pair blocks if there is no receiver. That's by design.

If you want to fail the send instead, use nng_aio_set_timeout() to set a short timeout.

@gdamore
Copy link
Contributor

gdamore commented Jul 21, 2024

It also blocks due to backpressure.

If you want a non-blocking (but will lose messages if receiver cannot keep up) pattern, check out PUB/SUB.

@gdamore
Copy link
Contributor

gdamore commented Jul 21, 2024

I'm closing this because there isn't a bug.

@gdamore gdamore closed this as completed Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants