diff --git a/.gitignore b/.gitignore index 8a19459..39421b7 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /MongoDB-v2.0.1.tar.gz /MongoDB-v2.0.2.tar.gz /MongoDB-v2.0.3.tar.gz +/MongoDB-v2.2.0.tar.gz diff --git a/MongoDB-v1.8.1-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch b/MongoDB-v1.8.1-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch deleted file mode 100644 index 8b2169d..0000000 --- a/MongoDB-v1.8.1-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 6ae53901ad2574172336b5680bc7a91788ece106 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Thu, 18 Jan 2018 14:31:01 +0100 -Subject: [PATCH] Revert PERL-715 Force localhost to connect via IPv4 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts: - -From 3bf06890a2675e323e09a0ff123f572ad23b2627 Mon Sep 17 00:00:00 2001 -From: David Golden -Date: Mon, 6 Mar 2017 23:36:35 -0500 -Subject: [PATCH] PERL-715 Force localhost to connect via IPv4 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some operating systems return IPv6 localhost addresses first, which fail -to connect if MongoDB isn't running on IPv6. - -Signed-off-by: Petr Písař ---- - lib/MongoDB/_Link.pm | 9 +-------- - t/connection.t | 15 --------------- - 2 files changed, 1 insertion(+), 23 deletions(-) - -diff --git a/lib/MongoDB/_Link.pm b/lib/MongoDB/_Link.pm -index ea2716f..30f6848 100644 ---- a/lib/MongoDB/_Link.pm -+++ b/lib/MongoDB/_Link.pm -@@ -31,7 +31,7 @@ use Moo; - use Errno qw[EINTR EPIPE]; - use IO::Socket qw[SOCK_STREAM]; - use Scalar::Util qw/refaddr/; --use Socket qw/SOL_SOCKET SO_KEEPALIVE SO_RCVBUF IPPROTO_TCP TCP_NODELAY AF_INET/; -+use Socket qw/SOL_SOCKET SO_KEEPALIVE SO_RCVBUF IPPROTO_TCP TCP_NODELAY/; - use Time::HiRes qw/time/; - use MongoDB::Error; - use MongoDB::_Constants; -@@ -165,16 +165,9 @@ sub connect { - - my ($host, $port) = split /:/, $self->address; - -- # PERL-715: For 'localhost' where MongoDB is only listening on IPv4 and -- # getaddrinfo returns an IPv6 address before an IPv4 address, some -- # operating systems tickle a bug in IO::Socket::IP that causes -- # connection attempts to fail before trying the IPv4 address. As a -- # workaround, we always force 'localhost' to use IPv4. -- - my $fh = $SOCKET_CLASS->new( - PeerHost => $host, - PeerPort => $port, -- ( lc($host) eq 'localhost' ? ( Family => AF_INET ) : () ), - Proto => 'tcp', - Type => SOCK_STREAM, - Timeout => $self->connect_timeout >= 0 ? $self->connect_timeout : undef, -diff --git a/t/connection.t b/t/connection.t -index 51bd0e1..a1dcd42 100644 ---- a/t/connection.t -+++ b/t/connection.t -@@ -131,19 +131,4 @@ subtest "app name" => sub { - or diag explain $ret->{output}; - }; - --subtest "localhost translated to 127.0.0.1" => sub { -- my $topo = $conn->_topology; -- $topo->scan_all_servers; -- my $link = $topo->get_readable_link; -- my $fh = $link->fh; -- -- plan skip_all => "Test needs IO::Socket::IP and localhost mongod" -- unless $fh->isa("IO::Socket::IP") && $conn->host =~ /localhost/; -- -- # IO::Socket::IP::as_inet is fatal unless socket is PF_INET -- eval { $fh->as_inet }; -- is( $@, '', "Socket can convert to plain INET (IPv4)" ); --}; -- -- - done_testing; --- -2.13.6 - diff --git a/MongoDB-v2.2.0-Disable-retrying-connect-in-tests.patch b/MongoDB-v2.2.0-Disable-retrying-connect-in-tests.patch new file mode 100644 index 0000000..ae77bda --- /dev/null +++ b/MongoDB-v2.2.0-Disable-retrying-connect-in-tests.patch @@ -0,0 +1,36 @@ +From 0bfba4730593fe0b3e82b86772ec1e5778531d09 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 14 Aug 2019 14:18:21 +0200 +Subject: [PATCH] Disable retrying connect in tests +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Tests retried a failed connect to non-existing server (TCP reset) +until a server_selection_timeout_ms timeout was reached. That means +every tests took 10 seconds if no server was running and the test was +expected to be skipped. + +This patch disables the retry so that it fails on a first rejected +connection and the test is skipped immediately. + +Signed-off-by: Petr Písař +--- + t/lib/MongoDBTest.pm | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/t/lib/MongoDBTest.pm b/t/lib/MongoDBTest.pm +index 70fe936..ae5eb32 100644 +--- a/t/lib/MongoDBTest.pm ++++ b/t/lib/MongoDBTest.pm +@@ -94,7 +94,6 @@ sub build_client { + ssl => $ssl || $ENV{MONGO_SSL}, + socket_timeout_ms => 120000, + server_selection_timeout_ms => $ENV{ATLAS_PROXY} ? 10000 : 2000, +- server_selection_try_once => 0, + wtimeout => 15000, + compressors => ['zlib'], + retry_writes => 1, +-- +2.21.0 + diff --git a/MongoDB-v2.2.0-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch b/MongoDB-v2.2.0-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch new file mode 100644 index 0000000..2a6b140 --- /dev/null +++ b/MongoDB-v2.2.0-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch @@ -0,0 +1,84 @@ +From 488239a1a626f752cc7fdba84361af61a6c72976 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 18 Jan 2018 14:31:01 +0100 +Subject: [PATCH] Revert PERL-715 Force localhost to connect via IPv4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts: + + From 3bf06890a2675e323e09a0ff123f572ad23b2627 Mon Sep 17 00:00:00 2001 + From: David Golden + Date: Mon, 6 Mar 2017 23:36:35 -0500 + Subject: [PATCH] PERL-715 Force localhost to connect via IPv4 + MIME-Version: 1.0 + Content-Type: text/plain; charset=UTF-8 + Content-Transfer-Encoding: 8bit + + Some operating systems return IPv6 localhost addresses first, which fail + to connect if MongoDB isn't running on IPv6. + +Signed-off-by: Petr Písař +--- + lib/MongoDB/_Link.pm | 9 +-------- + t/connection.t | 15 --------------- + 2 files changed, 1 insertion(+), 23 deletions(-) + +diff --git a/lib/MongoDB/_Link.pm b/lib/MongoDB/_Link.pm +index 25a77e0..8992824 100644 +--- a/lib/MongoDB/_Link.pm ++++ b/lib/MongoDB/_Link.pm +@@ -29,7 +29,7 @@ use Moo; + use Errno qw[EINTR EPIPE]; + use IO::Socket qw[SOCK_STREAM]; + use Scalar::Util qw/refaddr/; +-use Socket qw/SOL_SOCKET SO_KEEPALIVE SO_RCVBUF IPPROTO_TCP TCP_NODELAY AF_INET/; ++use Socket qw/SOL_SOCKET SO_KEEPALIVE SO_RCVBUF IPPROTO_TCP TCP_NODELAY/; + use Time::HiRes qw/time/; + use MongoDB::Error; + use MongoDB::_Constants; +@@ -277,16 +277,9 @@ sub connect { + + my ($host, $port) = split /:/, $self->address; + +- # PERL-715: For 'localhost' where MongoDB is only listening on IPv4 and +- # getaddrinfo returns an IPv6 address before an IPv4 address, some +- # operating systems tickle a bug in IO::Socket::IP that causes +- # connection attempts to fail before trying the IPv4 address. As a +- # workaround, we always force 'localhost' to use IPv4. +- + my $fh = $SOCKET_CLASS->new( + PeerHost => $ENV{TEST_MONGO_SOCKET_HOST} || $host, + PeerPort => $port, +- ( lc($host) eq 'localhost' ? ( Family => AF_INET ) : () ), + Proto => 'tcp', + Type => SOCK_STREAM, + Timeout => $self->connect_timeout >= 0 ? $self->connect_timeout : undef, +diff --git a/t/connection.t b/t/connection.t +index 84e5c2d..019343f 100644 +--- a/t/connection.t ++++ b/t/connection.t +@@ -133,19 +133,4 @@ subtest "app name" => sub { + or diag explain $ret->{output}; + }; + +-subtest "localhost translated to 127.0.0.1" => sub { +- my $topo = $conn->_topology; +- $topo->scan_all_servers; +- my $link = $topo->get_readable_link; +- my $fh = $link->fh; +- +- plan skip_all => "Test needs IO::Socket::IP and localhost mongod" +- unless $fh->isa("IO::Socket::IP") && $conn->host =~ /localhost/; +- +- # IO::Socket::IP::as_inet is fatal unless socket is PF_INET +- eval { $fh->as_inet }; +- is( $@, '', "Socket can convert to plain INET (IPv4)" ); +-}; +- +- + done_testing; +-- +2.21.0 + diff --git a/perl-MongoDB.spec b/perl-MongoDB.spec index 3c84f25..ec81ef3 100644 --- a/perl-MongoDB.spec +++ b/perl-MongoDB.spec @@ -1,4 +1,4 @@ -# Perform tests that use MongoDB server +# Perform tests that use a MongoDB server %if !(0%{?fedora} < 30) %bcond_with perl_MongoDB_enables_server_test %else @@ -6,8 +6,8 @@ %endif Name: perl-MongoDB -Version: 2.0.3 -Release: 3%{?dist} +Version: 2.2.0 +Release: 1%{?dist} Summary: A MongoDB Driver for Perl ## Installed: # lib/MongoDB/_Link.pm: ASL 2.0 and (GPL+ or Artistic) @@ -19,9 +19,11 @@ License: ASL 2.0 and (GPL+ or Artistic) URL: https://metacpan.org/release/MongoDB Source0: https://cpan.metacpan.org/authors/id/M/MO/MONGODB/MongoDB-v%{version}.tar.gz # Revert "localhost is IPv4 only" -Patch0: MongoDB-v1.8.1-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch +Patch0: MongoDB-v2.2.0-Revert-PERL-715-Force-localhost-to-connect-via-IPv4.patch # Remove useless dependency on ExtUtils::HasCompiler Patch1: MongoDB-v2.0.0-Remove-build-dependency-on-ExtUtils-HasCompiler.patch +# Skip tests on an unreachable server immediately +Patch2: MongoDB-v2.2.0-Disable-retrying-connect-in-tests.patch BuildArch: noarch # Build: BuildRequires: coreutils @@ -41,7 +43,7 @@ BuildRequires: sed # Authen::SASL::SASLprep not used at tests # Authen::SCRAM::Client 0.011 not used at tests BuildRequires: perl(boolean) >= 0.25 -BuildRequires: perl(BSON) >= 1.10.1 +BuildRequires: perl(BSON) >= 1.12.0 BuildRequires: perl(BSON::Bytes) BuildRequires: perl(BSON::Code) BuildRequires: perl(BSON::DBRef) @@ -82,7 +84,6 @@ BuildRequires: perl(Sub::Defer) BuildRequires: perl(Sub::Quote) BuildRequires: perl(Tie::IxHash) BuildRequires: perl(Time::HiRes) -BuildRequires: perl(Try::Tiny) BuildRequires: perl(Type::Library) BuildRequires: perl(Type::Utils) BuildRequires: perl(Types::Standard) @@ -102,7 +103,7 @@ BuildRequires: perl(File::Spec) BuildRequires: perl(IO::File) BuildRequires: perl(JSON::MaybeXS) # Log::Any::Adapter used only if MONGOVERBOSE environment variable is true -BuildRequires: perl(Path::Tiny) >= 0.054 +BuildRequires: perl(Path::Tiny) >= 0.058 BuildRequires: perl(Storable) BuildRequires: perl(Test::Deep) >= 0.111 BuildRequires: perl(Test::Fatal) @@ -122,7 +123,7 @@ Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version)) Suggests: perl(Authen::SASL) Requires: perl(Authen::SASL::SASLprep) Requires: perl(Authen::SCRAM::Client) >= 0.011 -Requires: perl(BSON) >= 1.10.1 +Requires: perl(BSON) >= 1.12.0 Requires: perl(BSON::Code) Requires: perl(BSON::DBRef) Requires: perl(BSON::Regex) @@ -146,10 +147,13 @@ ExcludeArch: ppc %{sparc} s390 %description The perl database access module for MongoDB. +Upstream claims it will drop support for this code on 2020-08-13. + %prep %setup -q -n MongoDB-v%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 # Remove bundled modules rm -r inc sed -i -e '/^inc\//d' MANIFEST @@ -173,7 +177,7 @@ if [ -n "$test_rc" ]; then cat mongod.log exit 1 fi -unset MONGOD MONGOVERBOSE +unset MONGOD MONGOVERBOSE TEST_MONGO_SOCKET_HOST export FAILPOINT_TESTING=1 %else export FAILPOINT_TESTING=0 @@ -192,6 +196,9 @@ exit $test_rc %{_mandir}/man3/* %changelog +* Wed Aug 14 2019 Petr Pisar - 2.2.0-1 +- 2.2.0 bump + * Fri Jul 26 2019 Fedora Release Engineering - 2.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index 1eaffb2..bd09742 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (MongoDB-v2.0.3.tar.gz) = 9ffda66833dcabb659a7f2d4c89371d7df03b2ff500184153cd04b7ce6e3f3f7890a4c86d2d0902317a0614de007015ec91d1a1b2bf11ce997919d884712e524 +SHA512 (MongoDB-v2.2.0.tar.gz) = 1e3359f6fb6b7cbc01dc6a6c4a8578d30b290760e0a77d0fceb5fb3fa255a6c24d376f4859a4b654fddcc1a3a5724ebecbfecffa3d422ac5723fc9a328000c93