Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5470B200CB6 for ; Thu, 29 Jun 2017 20:28:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 53C46160BED; Thu, 29 Jun 2017 18:28:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9A00A160BC6 for ; Thu, 29 Jun 2017 20:28:17 +0200 (CEST) Received: (qmail 96019 invoked by uid 500); 29 Jun 2017 18:28:16 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 95999 invoked by uid 99); 29 Jun 2017 18:28:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2017 18:28:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4180AC00A6 for ; Thu, 29 Jun 2017 18:28:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.049 X-Spam-Level: X-Spam-Status: No, score=-4.049 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Ege_ZuwZjdKP for ; Thu, 29 Jun 2017 18:28:15 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 202855F5B7 for ; Thu, 29 Jun 2017 18:28:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6ED92AB47E for ; Thu, 29 Jun 2017 18:28:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6ED92AB47E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=apache.org Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=astitcher@apache.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6ED92AB47E Received: from ovpn-121-227.rdu2.redhat.com (ovpn-121-227.rdu2.redhat.com [10.10.121.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBE7517A95 for ; Thu, 29 Jun 2017 18:28:13 +0000 (UTC) Message-ID: <1498760890.5609.1.camel@apache.org> Subject: Re: qpid-proton C++ on_sendable race condition From: Andrew Stitcher To: users@qpid.apache.org Date: Thu, 29 Jun 2017 19:28:10 +0100 In-Reply-To: <045c8440-4914-aed5-f89b-cf0c6962c3b0@pocock.pro> References: <045c8440-4914-aed5-f89b-cf0c6962c3b0@pocock.pro> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 29 Jun 2017 18:28:14 +0000 (UTC) archived-at: Thu, 29 Jun 2017 18:28:18 -0000 Sorry not to get back to you earlier - I've been at a conference for the past few days. Comments inline. On Tue, 2017-06-27 at 12:00 +0200, Daniel Pocock wrote: > > reSIProcate has a class QpidProtonThread[1] for sending to a topic. > > The class runs the container in a thread, the method > QpidProtonThread::thread() is the code executed in the thread when it > starts. > I'm assuming this is an application method as I don't recognise that name. > Another thread is calling the sendMessage(..) method.  That method > uses > event_loop()->inject(...) to have the doSend(...) method called > safely. > This appears to work for a while. Probably accidentally! The cross thread functionality was experimental (and rather broken) in the current (0.17) release. > > I notice that when the event loop calls my void_function0 class > operator(), which calls doSend(...), it is not calling it in the > container thread, it is being called in the thread that invoked > sendMessage(...).  Is that expected behaviour? That is the expected, but broken, behaviour - I said that released code was experimental! > > Eventually, the on_sendable() method is called.  I see it is being > called in the container's thread.  That method also calls > doSend(...). > At this point, the other thread becomes stuck. I expect it's a deadlock . > > I was thinking about simply removing the on_sendable() > method.  However, > given that I am using the inject method, should I not be having a > problem like this at all? If you can wait a couple of weeks the new C++ IO code should get merged to master and the 0.28 release made. This should fix the problem you are having. If you continue having problems then, or you want help trying the new code on the branch. Let me know Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org