LibreCat / Catmandu-Store-MongoDB

A searchable store backed by MongoDB
https://metacpan.org/pod/Catmandu::Store::MongoDB
4 stars 2 forks source link

Prepare for 1.0.0 MongoDB driver #6

Closed nics closed 9 years ago

nics commented 9 years ago

http://www.dagolden.com/index.php/2491/announcing-the-mongodb-perl-driver-v1-0-0-release-candidate/

jorol commented 9 years ago

Install of Catmand-Store-MongoDB 0.0303 against MongoDB RC2 reports an error:

#   Failed test 'expecting to throw a Catmandu::Error'
#   at t/02-connect.t line 28.
# expecting: Catmandu::Error
# found: MongoDB::SelectionError: No readable server available for matching read preference primary. MongoDB server status:
# Topology type: Single; Member status:
#   localhost:0 (type: Unknown, error: MongoDB::NetworkError: Could not connect to 'localhost:0': Es wurde eine Adresse verwendet, die mit dem angeforderten Protokoll nicht kompatibel ist. )
# Looks like you failed 1 test of 5.
t/02-connect.t .......... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests 
t/release-pod-syntax.t .. skipped: these tests are for release candidate testing

Test Summary Report
-------------------
t/02-connect.t        (Wstat: 256 Tests: 5 Failed: 1)
  Failed test:  5
  Non-zero exit status: 1
Files=4, Tests=18, 24 wallclock secs ( 0.06 usr +  0.06 sys =  0.13 CPU)
Result: FAIL
Failed 1/4 test programs. 1/18 subtests failed.

The connect_retry doesn't work anymore, as the new MongoDB driver uses lazy connections:

Lazy connection – creating a MongoDB::MongoClient object no longer connects to a server right away. This is the new standard for all official MongoDB drivers, but might break code that expected an immediate error from new!

Some of the $CLIENT_ARGS are deprecated or must be renamed.

jorol commented 9 years ago

Hi,

I want to deprecate the attributes connect_retry and connect_retry_sleep. What would be the best way? Print warnings when they are set and remove them in future version?

jorol

nics commented 9 years ago

Up to now, it's just mentioned in the pod, like so: http://cpansearch.perl.org/src/NICS/Catmandu-0.94/lib/Catmandu/Fix/retain_field.pm I found this on stackoverflow about best practices: http://stackoverflow.com/questions/1701118/how-can-i-mark-perl-code-as-deprecated?rq=1

On 08/26/2015 01:52 PM, jorol wrote:

Hi,

I want to depracate the attributes |connect_retry| and |connect_retry_sleep|. What would be the best way? Print warnings when they are set and remove them in future version?

jorol

— Reply to this email directly or view it on GitHub https://github.com/LibreCat/Catmandu-Store-MongoDB/issues/6#issuecomment-134962709.

jorol commented 9 years ago

MongoDB-v1.0.0 was just released. So #7 should be merged and released.

jorol commented 9 years ago

Thanks!