linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Fink <afink@list.fink.org>
To: linux-sctp@vger.kernel.org
Subject: EAGAIN
Date: Sun, 07 Jun 2020 12:18:40 +0000	[thread overview]
Message-ID: <0D6B7E65-36EC-4132-B02C-0371099E480A@list.fink.org> (raw)

Hello folks,

I run into a strange issue with SCTP under Linux and I'm not sure whats the right approach to fix this.

I have a listener thread which listens on a port for multiple inbound connections
I have a sender thread which sends packets to peers by using the same socket and doing a sctp_sendv call.
Sockets are always in non blocking mode.

When the remote side gets stopped (process killed),  the sctp_sendv starts returning 0 and errno is set to EAGAIN and we constantly retry.
We somehow didn't catch that this socket was down and end up in a busy loop (which we now fail after a certain amount of retries).

My question to you is whats the correct way to deal with EAGAIN here? Why are we not catching the assoc being down?
We have a sender thread and a receiver thread. The receiver thread is listening to events and should know.
Furthermore if the assoc is down the sctp_sendv could simply return something like socket not connected error instead of EAGAIN.

Or what am I missing here?


Andreas

PS: above was under Linux Debian Kernel 5.4.0-0.bpo.4.

             reply	other threads:[~2020-06-07 12:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-07 12:18 Andreas Fink [this message]
2020-06-07 12:47 ` EAGAIN Michael Tuexen
2020-06-07 12:59 ` EAGAIN Andreas Fink
2020-06-07 13:46 ` EAGAIN Michael Tuexen
2020-06-07 14:04 ` EAGAIN David Laight
2020-06-07 15:17 ` EAGAIN Michael Tuexen
2020-06-07 17:05 ` EAGAIN David Laight
2020-06-07 17:31 ` EAGAIN Michael Tuexen
2020-06-08  6:13 ` EAGAIN Andreas Fink

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0D6B7E65-36EC-4132-B02C-0371099E480A@list.fink.org \
    --to=afink@list.fink.org \
    --cc=linux-sctp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).