Skip to content
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

fix: Change socket timeout default to 0 [PORT] #2572

Merged
merged 8 commits into from Nov 6, 2020

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Oct 9, 2020

Socket timeout by default is infinity.

NODE-2835

Copy link
Contributor

@reggi reggi left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 100 to 112
it('should default socketTimeout to infinity', function(done) {
const client = new MongoClient(this.configuration.url());
client.connect(() => {
expect(client.s.options.socketTimeoutMS).to.deep.equal(0);
for (const connection of client.topology.s.coreTopology.connections()) {
expect(connection.socketTimeout).to.deep.equal(0);
}
done();
});
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mbroadst I saw your comment about missing testing on the 4.0 version of this, added a test here that I'll also add to 4.0 if this is all good ✅

Copy link
Member

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 100 to 112
it('should default socketTimeout to infinity', function(done) {
const client = new MongoClient(this.configuration.url());
client.connect(() => {
expect(client.s.options.socketTimeoutMS).to.deep.equal(0);
for (const connection of client.topology.s.coreTopology.connections()) {
expect(connection.socketTimeout).to.deep.equal(0);
}
done();
});
});

Copy link
Member

Choose a reason for hiding this comment

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

LGTM!

@nbbeeken nbbeeken force-pushed the NODE-2835/remove-default-read-timeout branch from 4c2af4e to 5cef410 Compare November 2, 2020 15:47
test/tools/runner/index.js Outdated Show resolved Hide resolved
@@ -799,7 +799,7 @@ describe('Collection', function() {

db.listCollections().toArray((err, documents) => {
expect(err).to.not.exist;
expect(documents.length > 1).to.be.true;
expect(documents.length >= 1).to.be.true;
Copy link
Member

Choose a reason for hiding this comment

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

what changed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test fails if you run it in isolation, it depends upon other tests to create multiple collections when it only creates one itself.

@nbbeeken nbbeeken force-pushed the NODE-2835/remove-default-read-timeout branch from 5e3fc3c to a0d94cc Compare November 5, 2020 18:51
Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

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

LGTM

@mbroadst mbroadst merged commit 89b77ed into 3.6 Nov 6, 2020
@mbroadst mbroadst deleted the NODE-2835/remove-default-read-timeout branch November 6, 2020 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants