Message from discussion
renctan sent you a message
Received: by 10.229.228.132 with SMTP id je4mr756222qcb.10.1289262602015;
Mon, 08 Nov 2010 16:30:02 -0800 (PST)
X-BeenThere: mongo-node-js-driver@googlegroups.com
Received: by 10.229.56.161 with SMTP id y33ls2165444qcg.1.p; Mon, 08 Nov 2010
16:30:01 -0800 (PST)
Received: by 10.229.192.15 with SMTP id do15mr713778qcb.22.1289262601399;
Mon, 08 Nov 2010 16:30:01 -0800 (PST)
Received: by 10.229.192.15 with SMTP id do15mr713777qcb.22.1289262601377;
Mon, 08 Nov 2010 16:30:01 -0800 (PST)
Return-Path: <pd...@nyu.edu>
Received: from mx1.nyu.edu (MX1.NYU.EDU [128.122.118.241])
by gmr-mx.google.com with ESMTP id 19si3016031qci.4.2010.11.08.16.30.01;
Mon, 08 Nov 2010 16:30:01 -0800 (PST)
Received-SPF: pass (google.com: best guess record for domain of pd...@nyu.edu designates 128.122.118.241 as permitted sender) client-ip=128.122.118.241;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of pd...@nyu.edu designates 128.122.118.241 as permitted sender) smtp.mail=pd...@nyu.edu
Received: from mail.nyu.edu (H3.HOME.NYU.EDU [128.122.118.83])
by mx1.nyu.edu (8.13.8/8.13.8) with ESMTP id oA90U0fO011400
for <mongo-node-js-driver@googlegroups.com>; Mon, 8 Nov 2010 19:30:00 -0500 (EST)
Received: from [128.122.20.44] by mail.alt.home.nyu.edu (mshttpd); Mon,
08 Nov 2010 19:30:00 -0500
From: Pratik Daga <pd...@nyu.edu>
To: mongo-node-js-driver@googlegroups.com
Message-ID: <57d090a51ccda1.4cd84fb8@mail.nyu.edu>
Date: Mon, 08 Nov 2010 19:30:00 -0500
X-Mailer: Sun Java(tm) System Messenger Express 6.3-11.01 (built Feb 12
2010; 64bit)
MIME-Version: 1.0
Content-Language: en
Subject: Re: [GitHub] renctan sent you a message
X-Accept-Language: en
Priority: normal
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Yeah I did that!! actually!!
But I think I got bigger bug in a process not in my code but in node.js
If I am not wrong.
Here is the scenario
Assume I have list of servers in ServerCluster Object.
a = new ServerCluster(Serverlist);
=> d = new db("testdb", a,....)
=> than I do sleep(50)// which do sleep for 50 sec in meanwhile I put server down and up again before it goes to next line
// I do this to get new master
=> d.open(err, reply){ // here it give me err that Connection is Reset... in node.js line no....
db.close();
}
it means that node.js don't except connection reset or server up/down in between.
It should not do this because db.open() check the above situation and have code to handle it .
And I am also using same logic in my code.
So until and unless I don't fix this or find the problem in code. Doesn't make any sense
Am I clear with problem?
----- Original Message -----
From: Kristina Chodorow <krist...@10gen.com>
Date: Monday, November 8, 2010 4:57 pm
Subject: Re: [GitHub] renctan sent you a message
To: mongo-node-js-driver@googlegroups.com
> Any update on removing the whitespace and global variables?
>
>
> On Wed, Nov 3, 2010 at 2:00 PM, Pratik Daga <pd...@nyu.edu> wrote:
>
> > It seems I need to clean up a lot, let me do it
> > also let me know how to change author name as my pc is own my
> friends name
> >
> > @rectan thanks for such a great review and suggestion
> >
> >
> > ----- Original Message -----
> > From: GitHub <nore...@github.com>
> > Date: Wednesday, November 3, 2010 11:42 am
> > Subject: [GitHub] renctan sent you a message
> > To: pd...@nyu.edu
> >
> >
> > > renctan sent you a message.
> > >
> > > --------------------
> > > Subject: Comments on Pull Request
> > >
> > > First of all, I would like to thank you for devoting your time for
> > > this project. You did a great job in submitting the code. Please allow
> > > me to make some comments on your code:
> > >
> > > Please cleanup your code - remove codes that you end up not using.
> For
> > > example, in query.js, the ReplSetServers you added does not seem
> to be
> > > used. Same thing for Db and Admin for connection.js.
> > >
> > > connection.js:
> > > 1. Do you intend to make serverlist a member variable of
> > > connection.js? Because the way it is right now, it behaves more
> like a
> > > static variable (in Java, C++ terminology). Notice that the serverlist
> > > variable will be overwritten with a new variable everytime the
> > > ReplSetServers constructor is called. If you want to make it behave
> > > like a member variable, you should put them inside a method of the
> > > object you intend it to belong to, for example:
> > >
> > > x.prototype.doThis = function () {
> > > this.serverlist = null; //this is a member variable of an instance
> of
> > > x
> > > };
> > >
> > > Yeah, I know, it's weird if you are used to languages like Java &
> C++,
> > > but you'll become used to it. I think most scripting languages use
> > > that idiom as Python and Ruby also use that idiom to create it's own
> > > "instance member variables".
> > >
> > > Nevertheless, you might not need serverlist variable as it appears
> > > that you are just passing it to the ServerCluster constructor.
> > >
> > > 2. Where is serverlistcopy being used?
> > >
> > > db.js:
> > > 1. Same comment on serverlist. Did you intend to use them as member
> > variables?
> > > 2. Same comment on dbcopy as behaving like static variable. I think
> > > you may not need dbcopy if you modify checkMaster to either:
> > >
> > > //make it accept a db instance
> > > var checkMaster = function (db) {
> > > //replace previous instances of dbcopy with db
> > > };
> > >
> > > and to use it at line 543:
> > > checkMaster(this);
> > >
> > > Alternatively, you can make also checkMaster be a method of db:
> > > Db.prototype.checkMaster = function () {
> > > //replace previous instances of dbcopy with this
> > > };
> > >
> > > and to use it at line 543:
> > > checkMaster();
> > >
> > > Which approach to use depends on your intent. I am also pretty much
> > > new to js, so I am not sure of the conventions used in js, but to
> me,
> > > the second approach would expose the method to the clients, so it
> > > seems to behave like public, while the first approach is not visible,
> > > so it acts more like a private method.
> > >
> > > Great job!
> > > --------------------
> > >
> > > Reply on GitHub: http://github.com/inbox/2533177#reply
> >