-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(NODE-5723): emit TopologyDescriptionChangedEvent just before close #3968
base: main
Are you sure you want to change the base?
Conversation
Failures were coming from old modified spec tests that have now been removed. |
@@ -302,7 +302,7 @@ describe('Socks5 Connectivity', function () { | |||
async function testConnection(connectionString, clientOptions) { | |||
const client = new MongoClient(connectionString, clientOptions); | |||
let topologyType; | |||
client.on('topologyDescriptionChanged', ev => (topologyType = ev.newDescription.type)); | |||
client.on('topologyDescriptionChanged', ev => (topologyType = ev.previousDescription.type)); |
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 function was previously relying on the fact that the last TopologyDescroptionChangedEvent
would be the one transitioning the topology to the fully known, desired operating state, with the description being in the newDescription
field.
Now that we emit a final instance of that event transitioning to the UNKNOWN
state, this final event would have the desired topology description in the previousDescription
field, rather than the newDescription
field.
9ffc31e
to
ae4163d
Compare
72ab133
to
4ff4aad
Compare
4ff4aad
to
be2e640
Compare
Note: this branch was rebased against #4089 which implements the UTR changes introduced in DRIVERS-2875 |
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.
code lgtm, one small question.
You are calling this a fix, was the previous event emission technically "wrong"? can you make your release notes describe the change in terms of what it is fixing?
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.
From slack:
missed a TODO skip message to run some of the tests ... that are failing because of an extra event emission
Just keeping this here for viz.
Description
What is changing?
logging-loadbalancer
testsTopologyDescriptionChangedEvent
transitioning toUnknown
Topology type just before closeIs there new documentation needed for these changes?
No
What is the motivation for this change?
NODE-5723 / DRIVERS-2711
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript