Hi Eliot,
The test is this:
1) We make a request to a probe URL, in which the application calls a
findOne(null) in some collection...
dvsantos@host-68880:~$ time curl -v "
http://127.0.0.1:9030/probe"
* About to connect() to 127.0.0.1 port 9030 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 9030 (#0)
> GET /probe HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/
1.2.3.4 libidn/1.18
> Host:
127.0.0.1:9030
> Accept: */*
>
< HTTP/1.1 500 Server Error
< Content-Length: 0
< Server: Jetty(7.5.0.RC2)
<
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
real 1m55.409s
user 0m0.000s
sys 0m0.004s
2) ... and after a certain time, we get an error like this:
Oct 17, 2011 6:36:34 PM com.mongodb.ReplicaSetStatus$Node update
WARNING: Server seen down: mongo1:27017
Oct 17, 2011 6:37:14 PM com.mongodb.ReplicaSetStatus$Node update
WARNING: Server seen down: mongo2:27017
Oct 17, 2011 6:38:14 PM com.mongodb.ReplicaSetStatus$Node update
WARNING: Server seen down: mongo3:27017
[ERROR] [17-10-2011 18:38:14.773] [u.n.r.service.FeedsReaderService]
3091 - Unable to probe external dependency, MongoBD is unavailable
(error-seq: host-68880-1)
uol.newsfeed.commons.exception.DBCollectionWrapperException: An error
occurred while executing the query null in the collection feed
at
uol.newsfeed.commons.mongo.DBCollectionWrapper.findOne(DBCollectionWrapper.java:
43)
at
uol.newsfeed.reader.service.impl.DefaultProbeService.probe(DefaultProbeService.java:
53)
Caused by: com.mongodb.MongoException: can't find a master
at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:406)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:193)
It happens when the lines of the replica sets (mongo1, mongo2, mongo3)
are commented in /etc/hosts.
P.S: It is not always 60 seconds as I said, but I can't find a way to
decrease or control this timeout.
On Oct 14, 11:17 pm, Eliot Horowitz <
el...@10gen.com> wrote:
> What are you testing exactly?
> What error are you getting after 60 seconds?
>
>
>
>
>
>
>
> On Fri, Oct 14, 2011 at 11:01 AM, Diogo Vernier <
verni...@gmail.com> wrote:
> > Hi,
>
> > To make a test, we've commented in /etc/hosts all the entries of the
> > replica sets, and started the application. But only after 60 seconds
> > an exception is thrown.
>
> > Setting connectTimeout, socketTimeout or waitTimeout to a proper
> > value, didn't change this behavior.
>
> > In this test, we were using theJavaclientdriver2.6.5, and the
> > following constructorhttp://
api.mongodb.org/java/2.6/com/mongodb/Mongo.html#Mongo(java.uti...,