All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo@debian.org>
Cc: Netfilter Development Mailing list <netfilter-devel@vger.kernel.org>
Subject: Re: [conntrack-tools PATCH 2/4] conntrackd: warn users about queue allocation errors
Date: Tue, 25 Apr 2017 15:16:53 +0200	[thread overview]
Message-ID: <20170425131653.GA1050@salvia> (raw)
In-Reply-To: <CAOkSjBh8rV0U1FjWYsOetKBzGyzMH4dx44ir+h6CikZdrWS5Eg@mail.gmail.com>

On Tue, Apr 25, 2017 at 02:40:45PM +0200, Arturo Borrero Gonzalez wrote:
> On 25 April 2017 at 13:34, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Thu, Apr 20, 2017 at 07:28:06PM +0200, Arturo Borrero Gonzalez wrote:
> >> These warnings, if they happen, should help users.
> >>
> >> Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
> >> ---
> >>  src/channel.c  |    6 +++++-
> >>  src/queue_tx.c |   11 +++++++++--
> >>  2 files changed, 14 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/src/channel.c b/src/channel.c
> >> index acbfa7d..b2f114d 100644
> >> --- a/src/channel.c
> >> +++ b/src/channel.c
> >> @@ -19,6 +19,7 @@
> >>  #include "channel.h"
> >>  #include "network.h"
> >>  #include "queue.h"
> >> +#include "log.h"
> >>
> >>  static struct channel_ops *ops[CHANNEL_MAX];
> >>  extern struct channel_ops channel_mcast;
> >> @@ -161,8 +162,11 @@ static void channel_enqueue_errors(struct channel *c)
> >>       struct channel_error *error;
> >>
> >>       qobj = queue_object_new(Q_ELEM_ERR, sizeof(struct channel_error));
> >> -     if (qobj == NULL)
> >> +     if (qobj == NULL) {
> >> +             dlog(LOG_WARNING, "could not enqueue channel errors, failed to"
> >> +                  " allocate memory");
> >
> > Did you ever hit this?
> >
>
> I don't know, no way to know in a production system since this happen silently.

No problem. I just wanted to know if you're addressing a real issue or
you just found this spot with not log message when passing by.

> Since conntrackd can be of critical importance in some environments I
> guess it doesn't harm to be more verbose. This concrete memory
> allocation failure isn't interesting per se, but it could be related
> to other more serious issues on the system.

Yes, but this is going to full the logs if ever happen.

Better add stats:

        /* statistics */
        struct {
                uint64_t        msg_rcv_malformed;
                uint32_t        msg_rcv_bad_version;
                uint32_t        msg_rcv_bad_payload;
                uint32_t        msg_rcv_bad_header;
                uint32_t        msg_rcv_bad_type;
                uint32_t        msg_rcv_truncated;
                uint32_t        msg_rcv_bad_size;
                uint32_t        msg_snd_malformed;
                uint64_t        msg_rcv_lost;
                uint64_t        msg_rcv_before;
        } error;

A quick glance at the code to see how we're globaling deal with lack
of memory would be good. There's little we can do in that situation,
and in my experience this most likely point to a memory leak.

So better follow a less agressive way than filling the logs, OK? We
indeed have a way to report this via the existing -s options.

  reply	other threads:[~2017-04-25 13:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 17:28 [conntrack-tools PATCH 1/4] conntrackd: factorice tx_queue functions Arturo Borrero Gonzalez
2017-04-20 17:28 ` [conntrack-tools PATCH 2/4] conntrackd: warn users about queue allocation errors Arturo Borrero Gonzalez
2017-04-25 11:34   ` Pablo Neira Ayuso
2017-04-25 12:40     ` Arturo Borrero Gonzalez
2017-04-25 13:16       ` Pablo Neira Ayuso [this message]
2017-05-02  8:34         ` Arturo Borrero Gonzalez
2017-05-02 10:03           ` Pablo Neira Ayuso
2017-05-02 10:09           ` Pablo Neira Ayuso
2017-04-20 17:28 ` [conntrack-tools PATCH 3/4] conntrackd: factorize resync operations Arturo Borrero Gonzalez
2017-05-08 17:52   ` Pablo Neira Ayuso
2017-04-20 17:28 ` [conntrack-tools PATCH 4/4] conntrackd: introduce RequestResync option Arturo Borrero Gonzalez
2017-04-25 11:37   ` Pablo Neira Ayuso
2017-04-25 12:46     ` Arturo Borrero Gonzalez
2017-04-25 13:18       ` Pablo Neira Ayuso
2017-04-26 11:32         ` Arturo Borrero Gonzalez
2017-05-01  9:13           ` Pablo Neira Ayuso
2017-05-02  8:18             ` Arturo Borrero Gonzalez
2017-05-08 17:47               ` Pablo Neira Ayuso
2017-05-08 17:52 ` [conntrack-tools PATCH 1/4] conntrackd: factorice tx_queue functions Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2017-04-20 16:40 Arturo Borrero Gonzalez
2017-04-20 16:40 ` [conntrack-tools PATCH 2/4] conntrackd: warn users about queue allocation errors Arturo Borrero Gonzalez

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=20170425131653.GA1050@salvia \
    --to=pablo@netfilter.org \
    --cc=arturo@debian.org \
    --cc=netfilter-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.