Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-2599

Binder on client side randomly fails subscription

    XMLWordPrintable

    Details

      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              jobol-iot josé bollo
              Reporter:
              knimitz Kazumasa Mitsunari
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: