Skip to content

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

Merged
merged 3 commits into from
Nov 27, 2017

Conversation

derickr
Copy link
Contributor

@derickr derickr commented Nov 20, 2017

Waiting on PHPC-1037 / PR #672

@derickr derickr requested a review from jmikola November 20, 2017 11:02
@jmikola
Copy link
Member

jmikola commented Nov 20, 2017

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.

@derickr derickr force-pushed the PHPC-1029-maxawaittimems-on-command branch from f305ba3 to b50f3b9 Compare November 23, 2017 10:31
@derickr derickr force-pushed the PHPC-1029-maxawaittimems-on-command branch from 8a12e4e to 4c33808 Compare November 23, 2017 12:44


# 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'
Copy link
Contributor Author

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,
Copy link
Contributor Author

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);
Copy link
Member

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);
Copy link
Member

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); ?>
Copy link
Member

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
Copy link
Member

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?

Copy link
Member

@jmikola jmikola left a 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.

@derickr derickr merged commit b3dcff2 into mongodb:master Nov 27, 2017
derickr added a commit that referenced this pull request Nov 27, 2017
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