Binder on client side randomly fails subscription

Description

Hi,

 

I find the afb-binder on client side ignores subscription randomly, so could you see the code?

I input the error log in afb-proto-ws.c, then found the place of error.

 

Jun 10 06:39:35 m3ulcb afbd-demo-app@0.3[3421]: ERROR: Failed to client_call_search_unlocked [/usr/src/debug/af-binder/guppy+gitAUTOINC+f878e8026a-r0/git/src/afb-proto-ws.c:517,client_msg_call_get] Jun 10 06:39:35 m3ulcb afbd-agl-demo-app@0.3[3421]: ERROR: Ignoring subscription to event [/usr/src/debug/af-binder/guppy+gitAUTOINC+f878e8026a-r0/git/src/afb-proto-ws.c:558,client_on_event_subscribe]

 

 

 

/* get event from the message */ static int client_msg_call_get(struct afb_proto_ws *protows, struct readbuf *rb, struct client_call **call) {     uint32_t callid;     /* get event data from the message */     if (!readbuf_uint32(rb, &callid)) {         ERROR("Failed to readbuf_uint32");         return 0;     }     /* get the call */     *call = client_call_search_unlocked(protows, callid);     if (*call == NULL) {         ERROR("Failed to client_call_search_unlocked");         return 0;     }     return 1; } // afb-proto-ws.c

Then,  "static struct client_call *client_call_search_locked" function(line 453) fails to find  struct client_call in mutex_lock

 

 

Note: I would like to get strace log but I couldn't because I couldn't reproduce when I execute with strace( write in service file like below). And I tried execute gdb with afb-daemon but GUI application couldn't find API , so couldn't try to call subscribe.... so sorry , I have only the place of error currently.

 

ExecStart=/usr/bin/strace -o /home/0/strace.log -P /usr/bin/afb-daemon /usr/bin/afb-daemon \ --name afbd-demo-app@0.3 \ --rootdir=/var/local/lib/afm/applications/demo-app/0.3 \ --workdir=/home/%i/app-data/ns-demo-app \ --verbose \ --verbose \ --monitoring \ --port=31012 \ --token=HELLO \ --roothttp=. \ --ws-client=unix:/run/user/%i/apis/ws/demo-service \ --exec /var/local/lib/afm/applications/demo-app/0.3/demo-app @p @t
[gdb] qml: afbws: sent: [2,"9955052826553583","demo-service/subscribe",{"event":"engine_speed"}] qml: afbws: sent: [2,"7415119148790836","demo-service/subscribe",{"event":"vehicle_speed"}] qml: afbws: sent: [2,"24231125647202134","demo-service/subscribe",{"event":"gear_selector_position"}] qml: afbws: received: [4,"9955052826553583",{"jtype":"afb-reply","request":{"status":"unknown-api","info":"api demo-service not found (for verb subscribe)","uuid":"21000bbb-0e53-497a-8a5f-da56330ad7f2"}}] qml: afbws: received: [4,"7415119148790836",{"jtype":"afb-reply","request":{"status":"unknown-api","info":"api demo-service not found (for verb subscribe)"}}] qml: afbws: received: [4,"24231125647202134",{"jtype":"afb-reply","request":{"status":"unknown-api","info":"api demo-service not found (for verb subscribe)"}}]

 

When I changed the code of server side from using afb_event_push to using afb_event_broadcast, then success to notify client of events.

 

Environment

GG 7.0.2

Attachments

1

Activity

Show:

Walt Miner 
July 30, 2019 at 9:38 PM

Close for HH 8.0.0 release

jose bollo 
July 15, 2019 at 9:20 AM
(edited)

Thank you for the feedback and the closing.

And yes, just replacing the binder is fine.

knimitz 
July 15, 2019 at 6:08 AM
(edited)

I tested on guppy, then it seems to be solved. ( I don't change image. Just I replaced afb-daemon and libafbwsc.so.1.1 only, but I think it's enough)

Stephane Desneux 
July 12, 2019 at 4:54 PM
(edited)

Pb seems to be solved with the proposed serie of patches (tested on master only) .

Jan-Simon Moeller 
July 12, 2019 at 3:43 PM

Submit them - we can have ci builds running in parallel.

Plan is to get things merged and tagged before leaving for ALS.

Fixed

Details

Assignee

Reporter

Labels

Contract ID

Priority

Created July 4, 2019 at 4:12 AM
Updated September 19, 2019 at 12:06 PM
Resolved July 15, 2019 at 6:08 AM

Flag notifications