Simon

Results 27 comments of Simon

@jackc thank you for your feedback! I left only one public function LaunchCleanup that does all the job of cleaning. I removed cleanup when transaction is commited/rollbacked with already canceled...

@jackc thank you for your feedback and explanations! I have remade this pr and put all recover logic inside pgconn. I have put recover logic into ResultReader and MultiResultReader when...

Sorry, just didnt merge master, fixed build failure, checked that https://github.com/zcolleen/pgx/actions/runs/7769417704 , now everything should be fine with tests

Okay, now i get your idea. But for me it has some disadvantages: 1. If i want to simply disable HandleCancel or define it with other functionality, that means we...

In fact i would have to write the entire library to support context cancelation with disabled Handler

> I don't think this is accurate. HandleCancel doesn't change the return value of the query method. I mean if i would redefine Handler, for example put long deadline to...

Opposite. I made this short example to clarify everything https://github.com/zcolleen/pgx_test/blob/no-error-example/main.go . In this example error is not returned while , as i see the correct behaviour of the library ,...

> Returning the context error says the query failed because of a context cancellation. But the query did complete successfully. Thats true on the one hand, but on the other...

Sure https://github.com/zcolleen/pgx_test/blob/context-check-example/main.go . If we could add error that is returned from rows.Err, than we wont have to check context after each query we make. That is also why the...

> the correct solution is for someLongMathOperationOrSomeLongExternalCall() to accept a context and handle its own cancellation That is the correct one, but we do not always know that we have...