freifunk-gluon / l3roamd

BSD 2-Clause "Simplified" License
12 stars 6 forks source link

-1 clients count in respondd #27

Closed genofire closed 6 years ago

genofire commented 6 years ago

node / respondd:

Wed Dec  6 18:52:22 2017 daemon.err respondd[2304]: could not send command to l3roamd socket: get_clients: Broken pipe

yanic:

2017/12/06 18:52:21 collector.go:224: unable to decode response from [fd2f:5119:f2d:0:5054:ff:fe38:4b77]:1001 json: cannot unmarshal number -1 into Go struct field Clients.total of type uint32
christf commented 6 years ago

I am not sure this is a l3roamd issue. This might be broken in the respondd module for the babel network. Could you query the l3roamd socket directly as well?

genofire commented 6 years ago

This happen just sometimes (round about every 10th request). I think either it is more are less a problem of gluon-respondd module for l3roamd and his problem to connect to l3roamd.

I did not like the value -1 there should not be a value, if it the request failed.

christf commented 6 years ago

hm. I rather like -1 to be specific about an error. However, we should investigate why sometimes the connection is not possible.

neocturne commented 6 years ago

How about not sending the field at all rather than sending an invalid value when there is a problem?

christf commented 6 years ago

actually, the -1 does not originate from l3roamd but from respondd returning an error value when connecting to the l3roamd socket. So while this is an issue, it is certainly not one for l3roamd.

I can do something like this, when compiling the json structure:

       if (total >= 0)
              json_object_object_add(ret, "total", json_object_new_int(total));
christf commented 6 years ago

b6bd1cc280dc573175e9ae65b97a6d50f76bfe50 hab ich im Angebot im n_babel-work-branch.

Ich schließ das mal hier und verlagere die Diskussion in den PR #934 aus gluon.