{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c/issues/149","repository_url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c","labels_url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c/issues/149/comments","events_url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c/issues/149/events","html_url":"https://github.com/eclipse/paho.mqtt.embedded-c/issues/149","id":349047762,"node_id":"MDU6SXNzdWUzNDkwNDc3NjI=","number":149,"title":"Unsubscribing topic returns fail","user":{"login":"rahulbpatel8","id":42235427,"node_id":"MDQ6VXNlcjQyMjM1NDI3","avatar_url":"https://avatars2.githubusercontent.com/u/42235427?v=4","gravatar_id":"","url":"https://api.github.com/users/rahulbpatel8","html_url":"https://github.com/rahulbpatel8","followers_url":"https://api.github.com/users/rahulbpatel8/followers","following_url":"https://api.github.com/users/rahulbpatel8/following{/other_user}","gists_url":"https://api.github.com/users/rahulbpatel8/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulbpatel8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulbpatel8/subscriptions","organizations_url":"https://api.github.com/users/rahulbpatel8/orgs","repos_url":"https://api.github.com/users/rahulbpatel8/repos","events_url":"https://api.github.com/users/rahulbpatel8/events{/privacy}","received_events_url":"https://api.github.com/users/rahulbpatel8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-09T09:26:24Z","updated_at":"2018-08-10T10:44:12Z","closed_at":null,"author_association":"NONE","body":"I have ported this library with esp-idf and using it with linux api platform. The issue I am facing is that when using MQTTUnsubscribe() from separate running task, it returns most of the time failure. but while using MQTTUnsubscribe() in subscribed message handler, it works fine.\r\nAfter some debugging in the library, I see that UNSUBACK is in the state machine runs in cycle but checks in waitfor() function gets failed in MQTTUnsubscribe(). \r\n  \r\n    if (waitfor(c, UNSUBACK, &timer) == UNSUBACK)\r\n    {\r\n        unsigned short mypacketid;  // should be the same as the packetid above\r\n        if (MQTTDeserialize_unsuback(&mypacketid, c->readbuf, c->readbuf_size) == 1)\r\n            rc = 0; \r\n    }\r\n    else\r\n        rc = FAILURE;\r\n\r\nwhile UNSUBACK cycle() already returns UNSUBACK to waitfor().\r\n\r\nThis causes MQTTUnsubscribe() fails. but this issue occurs only if the its called from other task then registered message handler. Is it related to context of two different task. I tried with locking use of cycle(), but same result.\r\n"},"comment":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c/issues/comments/412047138","html_url":"https://github.com/eclipse/paho.mqtt.embedded-c/issues/149#issuecomment-412047138","issue_url":"https://api.github.com/repos/eclipse/paho.mqtt.embedded-c/issues/149","id":412047138,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjA0NzEzOA==","user":{"login":"icraggs","id":10279016,"node_id":"MDQ6VXNlcjEwMjc5MDE2","avatar_url":"https://avatars1.githubusercontent.com/u/10279016?v=4","gravatar_id":"","url":"https://api.github.com/users/icraggs","html_url":"https://github.com/icraggs","followers_url":"https://api.github.com/users/icraggs/followers","following_url":"https://api.github.com/users/icraggs/following{/other_user}","gists_url":"https://api.github.com/users/icraggs/gists{/gist_id}","starred_url":"https://api.github.com/users/icraggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icraggs/subscriptions","organizations_url":"https://api.github.com/users/icraggs/orgs","repos_url":"https://api.github.com/users/icraggs/repos","events_url":"https://api.github.com/users/icraggs/events{/privacy}","received_events_url":"https://api.github.com/users/icraggs/received_events","type":"User","site_admin":false},"created_at":"2018-08-10T10:44:12Z","updated_at":"2018-08-10T10:44:12Z","author_association":"CONTRIBUTOR","body":"I presume that waitfor() returned with an error code?  What is it?\r\n\r\nAre you using the client mutex to block more than one call running simultaneously?"}}
{"actor":{"display_login":"icraggs"}}