Re: PGStream synchronization - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: PGStream synchronization
Date
Msg-id 4A9334C4.2060503@opencloud.com
Whole thread Raw
In response to PGStream synchronization  (Maciek Sakrejda <msakrejda@truviso.com>)
Responses Re: PGStream synchronization  (Maciek Sakrejda <msakrejda@truviso.com>)
List pgsql-jdbc
Maciek Sakrejda wrote:
> We've found some synchronization issues around PGStream in
> QueryExecutorImpl and ProtocolConnectionImpl. Specifically, while
> QueryExecutorImpl synchronizes all its uses off PGStream,
> ProtocolConnectionImpl uses the same PGStream directly when close() is
> called. This can easily cause protocol-level errors and,
> theoretically, at least, bad data shoved into a COPY IN query while
> the actual Connection.close() is ignored. This doesn't just affect
> COPY, though--anything that causes writes to the QueryExecutorImpl's
> pgStream could be affected.
>
> The only thing I've achieved so far is protocol-level errors, but
> that's a serious enough issue on its own.
>
> It's not immediately clear how to fix this, since we don't want to
> synchronize PGStream itself. Should ProtocolConnectionImpl just
> delegate to QueryExecutorImpl on close() perhaps, with
> QueryExecutorImpl handling the actual writes to PGStream?

What's the expected behaviour when Connection.close() is called
concurrently with other work happening on the connection - should the
close interrupt the current operation?

-O

pgsql-jdbc by date:

Previous
From: Maciek Sakrejda
Date:
Subject: PGStream synchronization
Next
From: Maciek Sakrejda
Date:
Subject: Re: PGStream synchronization