View Issue Details

IDProjectCategoryView StatusLast Update
0003534GNUnetcadet servicepublic2018-06-06 22:25
Reporterbratao Assigned ToBart Polot Due Date
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version8.1
Product VersionGit master 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0003534: Reset cadet is called too often, taking 100% CPU during transfer
DescriptionRunning GNUNet under Intel V-Tune I can see that reset_cadet is responsible for the majority of CPU usage. Often making the application use 100% of CPU.

From the function description, it was supposed to be called only when something wrong happened.


TagsNo tags attached.

Activities

bratao

2014-08-31 04:26

reporter   ~0008556

Futher checking the profile. Looks like that gnunet-service-fs and gnunet-service-cadet get in a loop. Both consuming 100% CPU and doing nothing, as the download transfer is already done ( an 600MB file transmitted with FS_delay setting disabled)

Looks like that transmit_sqm is called and the condition NULL == buf get hit every time. Calling the reset_cadet_async.

bratao

2014-08-31 04:32

reporter   ~0008557

Last edited: 2014-08-31 13:28

Yeah, look at this flow. It's a loop.

cadet_reset_task => reset_cadet = > GNUNET_CADET_channel_destroy =>
Inside GNUNET_CADET_channel_destroy:

if (GNUNET_YES == th_is_payload (th))
   th->notify (th->notify_cls, 0, NULL);

It calls transmit_sqm with buf == NULL, so it will always call => reset_cadet_aync << LOOP

Bart Polot

2014-08-31 18:30

reporter   ~0008558

One question might help: if transfer is done, why is a new transmission requested?

bratao

2014-08-31 18:38

reporter   ~0008559

I tried to fix it in r34248-34249.

It cancel the notify before destroying the cadet channel. I do not know if this is the right fix, but is working here nevertheless.

Bart Polot

2014-08-31 18:43

reporter   ~0008560

I saw the fix, and changed the API calls a little bit. My point is that cancelling whatever is pending before calling channel destroy is a good workaroud. A fix would be not to call transmit_ready when the transfer is done, in the first place, just call channel_destroy.

Also, indiscriminately calling reset_cadet on any NULL == buf seems a bit... radical ;)

bratao

2014-09-05 02:22

reporter   ~0008562

I fixed this some time ago

Issue History

Date ModifiedUsernameFieldChange
2014-08-31 04:06brataoNew Issue
2014-08-31 04:06brataoStatusnew => assigned
2014-08-31 04:06brataoAssigned To => Bart Polot
2014-08-31 04:26brataoNote Added: 0008556
2014-08-31 04:32brataoNote Added: 0008557
2014-08-31 04:34brataoNote Edited: 0008557
2014-08-31 13:28brataoNote Edited: 0008557
2014-08-31 18:30Bart PolotNote Added: 0008558
2014-08-31 18:38brataoNote Added: 0008559
2014-08-31 18:43Bart PolotNote Added: 0008560
2014-09-05 02:22brataoNote Added: 0008562
2014-09-05 02:22brataoStatusassigned => resolved
2014-09-05 02:22brataoResolutionopen => fixed
2014-09-30 08:31Christian GrothoffFixed in Version => 0.11.0pre66
2014-09-30 08:31Christian GrothoffTarget Version => 0.11.0pre66
2018-06-06 22:25Christian GrothoffStatusresolved => closed