-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-1029 Support maxTimeMS getMore option for tailable command cursors #673
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
PHPC-1029 Support maxTimeMS getMore option for tailable command cursors #673
Conversation
Looking at the diff, this change will conflict with #672 so I'll put off any review until that PR is merged and this can be rebased. |
f305ba3
to
b50f3b9
Compare
8a12e4e
to
4c33808
Compare
|
||
|
||
# Python stuff for mongo-orchestration | ||
apt-get install -y python python-dev python-pip | ||
|
||
pip install --upgrade 'git+https://github.com/10gen/mongo-orchestration.git#egg=mongo_orchestration' | ||
pip install --index-url=https://pypi.python.org/simple/ --upgrade 'git+https://github.com/10gen/mongo-orchestration.git#egg=mongo_orchestration' |
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.
The installed pip defaults to "http://pypi.python.org/simple/" which no longer works as it just returns "SSL is required"
], [ | ||
'tailable' => true, | ||
'awaitData' => true, | ||
'maxAwaitTimeMS' => 100, |
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.
Using "10" was too flakey, so hence made it 100ms.
if (command->max_await_time_ms) { | ||
bson_append_bool(&initial_reply, "awaitData", -1, 1); | ||
bson_append_int32(&initial_reply, "maxAwaitTimeMS", -1, command->max_await_time_ms); | ||
bson_append_bool(&initial_reply, "tailable", -1, 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.
You can use BSON_APPEND_BOOL()
and friends here, which will run strlen()
on the string literal.
|
||
php_phongo_zval_to_bson(document, PHONGO_BSON_NONE, bson, NULL TSRMLS_CC); | ||
intern->bson = bson; | ||
php_phongo_command_init(intern, document, options TSRMLS_CC); |
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.
The return value is never checked here. Should we free intern->bson
on error, or call the dtor? Or are we trusting PHP to run the dtor for us, since a false
return value will correlate with an exception being thrown?
@@ -2,12 +2,12 @@ | |||
MongoDB\Driver\BulkWrite::update with arrayFilters | |||
--SKIPIF-- | |||
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?> | |||
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?> | |||
<?php START('THROWAWAY', ["version" => "36-release"]); CLEANUP(THROWAWAY); ?> |
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 shouldn't be necessary, since 3.6 should be the default for MO (as the first version listed).
@@ -0,0 +1,71 @@ | |||
--TEST-- | |||
MongoDB\Driver\Cursor tailable iteration with awaitData and maxAwaitTimeMS options |
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 this title be changed to refer to commands, or not 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.
LGTM. Please create the separate ticket to cleanup THROWAWAY
.
Waiting on PHPC-1037 / PR #672