Repository navigation
Conversation
| server_descriptions = selection.server_descriptions | ||
| server_descriptions = [s for s in server_descriptions if s.round_trip_time != None] |
There was a problem hiding this comment.
Do we need to re-assign here? Shouldn't we do it in a one-liner?
| server_descriptions = selection.server_descriptions | ||
| server_descriptions = [s for s in server_descriptions if s.round_trip_time != None] | ||
| if not server_descriptions: | ||
| return [] |
There was a problem hiding this comment.
| server_descriptions = selection.server_descriptions | |
| server_descriptions = [s for s in server_descriptions if s.round_trip_time != None] | |
| if not server_descriptions: | |
| return [] | |
| server_descriptions = [s for s in (selection.server_descriptions or []) if s.round_trip_time is not None] | |
| if not server_descriptions: | |
| return [] |
expobrain
left a comment
There was a problem hiding this comment.
We have already the patched version in the branch https://github.com/withplum/mongo-python-driver/tree/4.5.0-patched
|
Hello, thanks for the PR. As stated in PYTHON-1271 it's unexpected for this case to happen since at this point all the servers should be in a known state with a non-None value for round_trip_time. Are you able to reproduce this issue? If so, it would be better for us to debug this case to understand the root cause. |
|
@piyiotisk, @KonstantinosTsitoumis, @stavros47, @expobrain Are you able to reproduce this issue? If so, it would be better for us to debug this case to understand the root cause. |
|
We're going to close this pull request for now, please comment if you'd like us to open it back up. |
|
Hi, i'm still able to reproduce this issue with pymongo v4.6.1. The root cause of the error is probably due to our configuration of the topology / replica set but it would be helpful if this was handled in a more specific way, instead of getting a generic TypeError when computing this list comprehension. I think the solution proposed here was to basically return an empty list in such cases, but I'm not sure wether that's the best way to handle this, and I would prefer to have a ConfigurationError specifying what's wrong in the configuration in this case. @blink1073 @ShaneHarvey would you consider re-opening this issue? |
This PR fixes the following error. This is a part of our CI pipeline (withplum.com)
Unfortunately, almost in every build we encounter this failure. Locally it's difficult to reproduce.
Here's the Jira ticket from Mongodb https://jira.mongodb.org/browse/PYTHON-1271