Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHWYS-0001Jo-BS for psycopg@arkaria.postgresql.org; Tue, 30 Oct 2018 16:07:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHWYP-0004R9-PQ for psycopg@arkaria.postgresql.org; Tue, 30 Oct 2018 16:07:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHWYP-0004Pn-Hp for psycopg@lists.postgresql.org; Tue, 30 Oct 2018 16:07:41 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gHWYM-0003Cz-NA for psycopg@postgresql.org; Tue, 30 Oct 2018 16:07:40 +0000 Received: by mail-lj1-x234.google.com with SMTP id s15-v6so11932755lji.3 for ; Tue, 30 Oct 2018 09:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ww5YmV/JaCaie5pOR1HszfxtuYjynEVzCEG5KFyhrw=; b=i4vtsy4CCHJ4VDaMiE4bOLm/3XujWFdhvqkaYnSpFuoJB7wzxamleuqAUp0Ar+xw6E a1rbidHDZOuRKJGDRvfUiQuzWqgGDE7f7xJK77LRIqD2jJO+yuYDcrpdL9FeZKDIuWmk ze/gg4KatrYcvcfagIcJOG/klp8PqgJzNbDI9+8Z+pSHZmDXkI5VPCDpLvJcLD+Zd9Fw SFNqC14tLQ9ghuXKKdckrSrtr85oS2fSnfMXmsThBoW3sGKf87AMPp5g6aT+o90CXuFA ub1HU5YVOsAF6dMirOK92proP8BsT4ejY0VZLfbw9Djqkq1WY1R+TUwMf6DzPPP+lagT QeMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8ww5YmV/JaCaie5pOR1HszfxtuYjynEVzCEG5KFyhrw=; b=kxa4ORnTFFgTjUrN2xvjtVaTz7pAEq62HK7xeRhn7SUX+UJHmsbAbSJgNs5Nz8zIqM 2gnFu5JlHBFIzZ7dXu+XIYbSE7HOYk/VXJlFdtI6W5xDJpW1r2Kyp+t26hkC69+l+fGT /QhehDD2xWtq2bBuDqUj2krd/xZrZFL9dNuWUNRfBP//1xtetRXuDUfEXNrUr/V1IMeC Yugh68r4x+qS+cOZaF7xBvkSGAaAbbNS2wzoiPEuSJXM33MFrSPnde3X481LykJL8S/L t+mH8cv8nhqp6HFaKtJuEuOXvTD4llbNb9KYDXBkyYGlas1fJ2WhXYd1/6EoQ7ATtOGA ctAQ== X-Gm-Message-State: AGRZ1gKxh3hYS+BdgD6mgptdL0fkIbu3x6Pp1b8m8y8O5Mn7WbckwXN5 oGI+gRhcCLt1SDE3565QDQXIIL78iZScRmoaLkM= X-Google-Smtp-Source: AJdET5dSFrQ662VUSKnE8ng5PZjiRn/rsZqwfLyhn6ILqESRrRDI4GJq/x8o3a6wIzjdBsyNOnYwqbijqOTMUIf+sBU= X-Received: by 2002:a2e:9a14:: with SMTP id o20-v6mr12702576lji.17.1540915657475; Tue, 30 Oct 2018 09:07:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Varrazzo Date: Tue, 30 Oct 2018 16:07:25 +0000 Message-ID: Subject: Re: psycopg2 conn.poll() hangs when used with sshtunnel To: Akshay Joshi Cc: psycopg@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Oct 30, 2018 at 3:57 PM Akshay Joshi wrote: > > I have one more observation when i run this application one out of 10 times it works. I have logged one more issue as COPY command hangs, so thought it is the problem in psycopg2 The problem with COPY was a different one: we just didn't manage the state resulting by running COPY through execute, and ended up looping forever on fake results returned by the libpq. The condition was detected and handled for COPY BOTH (resulting by replication statements) but not for the normal COPY TO/FROM. See . This is a different story but, as described in it seems that even if we are doing something not entirely legit with isBusy/consumeInput/getResult, it only becomes a problem through the sshtunnel module, not through ssh -L. -- Daniele