Re: [PATCH nft 2/7] json: drop messages "warning: stmt ops chain have no json callback"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2023-11-02 at 09:04 +0100, Florian Westphal wrote:
> Thomas Haller <thaller@xxxxxxxxxx> wrote:
> > This message purely depends on the internal callbacks and at the
> > program
> > code. This is not useful. What is the user going to do with this
> > warning?
> 
> Report a bug.

The way the message is worded ("warning:"), doesn't sound as if a user
should feel invited to report a bug.


> > Maybe there is a bug here, but then we shouldn't print a warning
> > but fix
> > the bug.
> 
> How on earth do we do that, fix a bug before we know its there?

Writing tests that perform basic consistency checks of things that must
hold.

A unit test should check whether ops structs are consistent. This
patchset also enables a test that hits this problem (for "chain" ops).

If there is a bug, then an assertion (or just a plain crash) would be
preferable over printing a "warning" to stderr.

> 
> > For example, calling `nft -j list ruleset` after test
> > "tests/shell/testcases/chains/0041chain_binding_0"
> > will trigger messages like:
> > 
> >   warning: stmt ops chain have no json callback
> >   warning: stmt ops chain have no json callback
> 
> That means that chain ops needs a bug fix as they do not support
> json output?

I don't know. The message might just trying to be helpful, and there is
no actual problem. The condition is attempted to be handled by the
following code.

I don't know which it is. Me sending the patch is basically asking that
question.



Thomas





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux