View Issue Details

IDProjectCategoryView StatusLast Update
0001801GNUnettransport servicepublic2011-09-30 13:01
ReporterMatthias Wachs Assigned ToMatthias Wachs  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target VersionGit master 
Summary0001801: Transport service does not notify clients about shutdown
DescriptionTransport service does a shutdown
Client waiting for GNUNET_TRANSPORT_notify_transmit_ready

-> Assertion transport.api.c:379
GNUNET_assert (n->th!= NULL)

Shouldn't transport service notify clients about shutdown in
gnunet_transport_service.c : shutdown_task : GST_clients_stop ??

Current implementation:
GST_clients_stop ()
{
  /* nothing to do */
}
Steps To Reproduceinterrupt test_transport_api_reliability while running
TagsNo tags attached.

Activities

Matthias Wachs

2011-09-27 17:50

manager   ~0004631

OR but imho dangerous is client is really gone (and n->th freed):

change transport_api.c to call callback

static int
neighbour_delete (void *cls, const GNUNET_HashCode * key, void *value)
{
  struct GNUNET_TRANSPORT_Handle *handle = cls;
  struct Neighbour *n = value;

  if (NULL != handle->nd_cb)
    handle->nd_cb (handle->cls, &n->id);

  if (n->th != NULL)
  {
    GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th);
    n->th->notify(n->th->notify_cls, 0, NULL);
  }

  GNUNET_assert (NULL == n->th);

Christian Grothoff

2011-09-27 20:49

manager   ~0004632

The transport service is certainly not at fault here. It should NOT notify clients about the shutdown, the shutdown should look like a service crash to the clients -- and be handled nicely (by trying to re-connect with exponential back-off).

Christian Grothoff

2011-09-29 00:57

manager   ~0004642

Actually, looking at this more closely, the code at fault is neither the transport service nor transport_api, but the process using either! What is wrong is that the calling process (which is unfortunately NOT given in the report), must call "GNUNET_TRANSPORT_notify_transmit_ready_cancel" *during* the "handle->nd_cb" callback (also given above). So *during* the disconnect callback the client is expected to cancel pending requests. If the client fails to do so, we abort (assertion failure) because our API was violated.

So --- which one was the process that died with this assertion failure to begin with?

Matthias Wachs

2011-09-30 13:00

manager   ~0004661

fixed in 17135

Issue History

Date Modified Username Field Change
2011-09-27 17:47 Matthias Wachs New Issue
2011-09-27 17:47 Matthias Wachs Status new => assigned
2011-09-27 17:47 Matthias Wachs Assigned To => Matthias Wachs
2011-09-27 17:50 Matthias Wachs Note Added: 0004631
2011-09-27 17:50 Matthias Wachs Status assigned => feedback
2011-09-27 20:49 Christian Grothoff Note Added: 0004632
2011-09-29 00:57 Christian Grothoff Note Added: 0004642
2011-09-30 13:00 Matthias Wachs Note Added: 0004661
2011-09-30 13:00 Matthias Wachs Status feedback => assigned
2011-09-30 13:01 Matthias Wachs Status assigned => closed
2011-09-30 13:01 Matthias Wachs Resolution open => fixed