On Tue, Oct 30, 2018 at 3:57 PM Akshay Joshi <akshay.jo...@enterprisedb.com> 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 <https://github.com/psycopg/psycopg2/issues/781>. This is a different story but, as described in <https://github.com/pahaz/sshtunnel/issues/135> 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