Details
-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
None
-
GG 7.0.2
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.
Attachments
Issue Links
# | Subject | Branch | Project | Status | CR | V |
---|---|---|---|---|---|---|
21862,1 | afb-evt: Improve compatibility to guppy | master | src/app-framework-binder | Status: MERGED | +2 | 0 |
21863,1 | afb-evt: send events in separate job | master | src/app-framework-binder | Status: MERGED | +2 | 0 |
21864,1 | Revert "afb-stub-ws: Allow unordered process of messages" | master | src/app-framework-binder | Status: MERGED | +2 | 0 |
21865,2 | afb-xreq: Forbids (un)subscribes after reply | master | src/app-framework-binder | Status: MERGED | +2 | 0 |
21867,1 | afb-evt: send events in separate job | guppy | src/app-framework-binder | Status: MERGED | +2 | 0 |
21868,2 | Revert "afb-stub-ws: Allow unordered process of messages" | guppy | src/app-framework-binder | Status: MERGED | +2 | 0 |
21869,2 | afb-xreq: Forbids (un)subscribes after reply | guppy | src/app-framework-binder | Status: MERGED | +2 | 0 |
21870,2 | af-binder: Fix of subscribe issue | master | AGL/meta-agl | Status: MERGED | +2 | +1 |
21872,1 | af-binder: Fix of subscribe issue | guppy | AGL/meta-agl | Status: MERGED | +2 | +1 |