Skip to content

PHPC-2023 and PHPC-2030: Allow observation of events dispatched during client destruction #1292

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

Merged
merged 2 commits into from
Jan 14, 2022

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jan 13, 2022

/* If we are in request shutdown, disable APM to avoid dispatching more
* events. This means that certain events (e.g. TopologyClosedEvent,
* command monitoring for endSessions) may not be observed. */
if (EG(flags) & EG_FLAGS_IN_SHUTDOWN) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@sgolemon: If I may pick your brain for a moment: Is this something we can reasonably rely on going forward? It's hard to tell what's public and private in the Zend headers, but this seemed pretty accessible.

Copy link
Contributor

Choose a reason for hiding this comment

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

Per slack. This seems to be the best you'll get for now. :(

Will followup with php-internals about this though.

Observation is only possible for non-persistent clients freed before RSHUTDOWN. This change also allows for reliable testing of ServerClosedEvent.
Command monitoring events can only be observed for non-persistent clients freed before RSHUTDOWN.
@jmikola jmikola merged commit c2410ab into mongodb:master Jan 14, 2022
@jmikola jmikola deleted the phpc-2023 branch January 14, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants