-
Notifications
You must be signed in to change notification settings - Fork 211
PHPC-349: Implement APM specification #466
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
Conversation
3b32820 to
5dccaec
Compare
5c84933 to
6f039a1
Compare
6f039a1 to
82a6a19
Compare
c781336 to
5c02997
Compare
It only does this if there are failed tests, but XFAIL is not included in the "failed tests".
5c02997 to
bd76843
Compare
php_phongo.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should function calls and statements appear after variable declarations in the same scope? IIRC, this is why TSRMLS_FETCH() can't precede declarations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed as far as I know. Our compile flags also create a warning if we do this wrong (through -Werror=declaration-after-statement).
From what I understand, you can define a variable and initialise this, but C90 does not allow to have "just code" before further variable declarations/initialisations.
config.m4
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we alphabetize these for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - although, they're now ordered logically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did keep the logical order when initializing the class entries in #568.
config.w32
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we alphabetize these for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, although they're now ordered logically.
php_phongo.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used once in this function. Why not remove the local variable and relocate mongoc_apm_command_succeeded_get_context() to the p_event->client assignment below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since TSRMLS_FETCH() is defined as nothing in PHP 7+, would it make sense to combine the declarations and iteration so this function has a single #if block?
php_phongo.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This local can also be removed by inlining this in the p_event->client assignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
src/MongoDB/Manager.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be inadvertently added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not new code, probably comes from a mess while rebasing.
src/MongoDB/Manager.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused, as the function entry uses MongoDB_disabled___wakeup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not new code, probably comes from a mess while rebasing.
src/MongoDB/Manager.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was definitely needed when I wrote the code. If any code in this file uses MONGODB_G, it needs to be there. Seems that we removed all of that code though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this done here instead of phongo_manager_init()? Also, if the client was persisted from a previous request, shouldn't the callbacks already be applied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as my comment on the HHVM PR, in earlier discussions we came to the conclusion that we didn't want to remove the apm callbacks at request shutdown, and to be safe, always set them upon Manager creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, I think we can still move this to phongo_manager_init() just to keep this logic out of the constructor. I'd like to revisit down the line with some testing over multiple requests to see if re-assignment is really necessary. Since the callbacks are fixed functions, I have a feeling this has no effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If zend_hash_update() doesn't add a reference, are you sure that this removes a reference on the zval after deleting it from the hash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose if there was a leak, the removeSubscriber() tests would catch it. I found no issues running Valgrind locally for 5.6-zts and 7.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, as the hash dtor uses zval_ptr_dtor on the element, it shouldn't be needed. AFAIK, the dtor decreases the refcount and frees when the refcount hits 0.
Most of the minor comments (e.g. formatting, alphabetizing) are addressed in #568.
No description provided.