diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index d90ff4ab4..e6dceb33f 100755 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -7,9 +7,6 @@ cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/ # Replace MongoOrchestration's client certificate. cp ${PROJECT_DIRECTORY}/test/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem -# Ensure hatch is installed. -bash ${PROJECT_DIRECTORY}/.evergreen/scripts/ensure-hatch.sh - if [ -w /etc/hosts ]; then SUDO="" else diff --git a/.evergreen/scripts/ensure-hatch.sh b/.evergreen/scripts/ensure-hatch.sh index a57b70512..e63d98bb6 100755 --- a/.evergreen/scripts/ensure-hatch.sh +++ b/.evergreen/scripts/ensure-hatch.sh @@ -2,6 +2,9 @@ set -eu +HERE=$(dirname ${BASH_SOURCE:-$0}) +pushd "$(dirname "$(dirname $HERE)")" > /dev/null + # Ensure hatch is available. if [ ! -x "$(command -v hatch)" ]; then # Install a virtual env with "hatch" @@ -53,3 +56,4 @@ if [ ! -x "$(command -v hatch)" ]; then echo "Installing hatch... done." fi hatch --version +popd > /dev/null diff --git a/.evergreen/setup-spawn-host.sh b/.evergreen/setup-spawn-host.sh index 4de2153d5..1a526c762 100755 --- a/.evergreen/setup-spawn-host.sh +++ b/.evergreen/setup-spawn-host.sh @@ -8,9 +8,11 @@ if [ -z "$1" ] fi target=$1 +remote_dir=/home/ec2-user/mongo-python-driver echo "Copying files to $target..." -rsync -az -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:/home/ec2-user/mongo-python-driver +rsync -az -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:$remote_dir echo "Copying files to $target... done" -ssh $target /home/ec2-user/mongo-python-driver/.evergreen/scripts/setup-system.sh +ssh $target $remote_dir/.evergreen/scripts/setup-system.sh +ssh $target "PYTHON_BINARY=${PYTHON_BINARY:-} $remote_dir/.evergreen/scripts/ensure-hatch.sh" diff --git a/.evergreen/sync-spawn-host.sh b/.evergreen/sync-spawn-host.sh index 4c3e276d4..3d6c96890 100755 --- a/.evergreen/sync-spawn-host.sh +++ b/.evergreen/sync-spawn-host.sh @@ -8,6 +8,7 @@ fi target=$1 echo "Syncing files to $target..." +rsync -haz -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:/home/ec2-user/mongo-python-driver # shellcheck disable=SC2034 fswatch -o . | while read f; do rsync -hazv -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:/home/ec2-user/mongo-python-driver; done echo "Syncing files to $target... done." diff --git a/pymongo/pyopenssl_context.py b/pymongo/pyopenssl_context.py index 50d8680a7..a320e9492 100644 --- a/pymongo/pyopenssl_context.py +++ b/pymongo/pyopenssl_context.py @@ -125,7 +125,8 @@ class _sslConn(_SSL.Connection): try: return call(*args, **kwargs) except BLOCKING_IO_ERRORS as exc: - if is_async: + # Do not retry if the connection is in non-blocking mode. + if is_async or timeout == 0: raise exc # Check for closed socket. if self.fileno() == -1: