Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conn: dont propogate context cancelled in prepare (apache#1368)
* conn: dont propogate context cancelled in prepare If a callers context is cancelled and they won the race to prepare a statement, dont stop the prepare and fail it with context failed error as other callers may be waiting for us to finish. Achieve this by replacing the waitgroup used to wait for prepared to finish with a channel which is closed by the preparer. Do the preparing in a goroutine and use context.Background in the exec call so that the prepare will always finish. All callers now use the same flow to wait for the result of the prepare waiting against their own context so they can bail out individually. fixes apache#1341 * ensure closing a connection kills inflight prepares
- Loading branch information