Bug 747 - log_assert in outnet_serviced_query_stop
log_assert in outnet_serviced_query_stop
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.6
x86_64 Linux
: P5 major
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-04 20:09 CET by Charles Walker
Modified: 2016-03-07 11:01 CET (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Walker 2016-03-04 20:09:48 CET
Running some load tests against unbound, we are sporadically seeing an issue in which outnet_serviced_query_stop is trying to remove a serviced_query from the rb tree, and asserting because the serviced_query was not found in the rb tree.  It calls log_assert to verify that the element was removed from the rb tree and since it was not in the rb tree, the process exits.

We thought that it might have been triggered by setting so_reuseport to yes because we were seeing with so_reuseport set to yes, but we have subsequently seen it without so_reuseport set to yes.

The snippet of code where this is happening is shown below.  

void outnet_serviced_query_stop(struct serviced_query* sq, void* cb_arg)
{
        if(!sq)
                return;
        callback_list_remove(sq, cb_arg);
        /* if callbacks() routine scheduled deletion, let it do that */
        if(!sq->cblist && !sq->to_be_deleted) {
#ifdef UNBOUND_DEBUG
                rbnode_t* rem =
#else
                (void)
#endif
                rbtree_delete(sq->outnet->serviced, sq);
                log_assert(rem); /* should be present */
                serviced_delete(sq);
        }
}

Thanks,
Charles Walker
Comment 1 Wouter Wijngaards 2016-03-07 11:01:56 CET
Hi Charles,

Thank you for the report.

I have removed the assert, because, it should be harmless to continue.  And downtime is not good.

If you have more details, eg. queries that are in progress or exceptional matters at the time, that would be very useful.

Best regards, Wouter