Skip to content

ext/pgsql: pg_cancel_query internal update. #11081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

Removing (obsolete) PGrequestCancel usage in favor of the thread-safe
PQcancel/PQfreeCancel pair.


if (!c) {
// only possible reason since the connection is already verified at that point
zend_error(E_WARNING, "can't allocate a cancel procedure");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't pgsql use ZMM? in which case the engine will bailout before.

If not, well that's something that is suboptimal but requires pgsql to allow setting a custom allocator.

PS: still on holiday for a week but going through the wooping amount of emails I got

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good point

@devnexen devnexen force-pushed the pgsql_cancel_query_update branch from 40383d3 to c30a220 Compare May 1, 2023 12:27
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit but LGTM :)

c = PQgetCancel(pgsql);
RETVAL_LONG((rc = PQcancel(c, err, sizeof(err))));
if (rc < 0) {
zend_error(E_WARNING, "can't cancel the query: %s", err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think this is our usually spelling

Suggested change
zend_error(E_WARNING, "can't cancel the query: %s", err);
zend_error(E_WARNING, "cannot cancel the query: %s", err);

Removing (obsolete) PGrequestCancel usage in favor of the thread-safe
 PQcancel/PQfreeCancel pair.
@devnexen devnexen force-pushed the pgsql_cancel_query_update branch from c30a220 to b022108 Compare May 5, 2023 09:56
@devnexen devnexen closed this in 84c185c May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants