-
Hello, I'm working on a Postgres connector for the Conduit system and I noticed a race in the tests; In this instance, I'm using a pgconn directly which is used to stream changes using pg logical replication (using jack's pglogrepl pkg ). The logical replication reader is running in a go routine. When the connector needs to be torn down, there is a potential for the context passed to the teardown to get cancelled which will close the function early and hit the The data race in this case is between Test to code is here https://github.com/ConduitIO/conduit-connector-postgres/blob/3acff90e92bdbb3e0efde716a0af4baf531bccc1/source/logrepl/cdc_test.go#L324-L341 Thank you!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
*pgconn.PgConn
is not concurrency safe. It appears this code is callingClose()
from one goroutine while another goroutine is using the*pgconn.PgConn
. That is not supported.