Re: jdbc and nfs

Lists: pgsql-jdbc
From: "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: jdbc and nfs
Date: 2008-02-16 18:07:49
Message-ID: a6ee49d30802161007m789ce06fm274848c5d9b54e9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi!

I'm having a problem connecting with jdbc to a pg server using a user
account with an nfs mounted home directory.

Here's the scenario:

The pg server is running on server B (openSUSE) and I'm connecting to
it from server C (Solaris 10) using a user account with an nfs mounted
directory from server A (openSUSE).

If I unmount the nfs share it works! But with the share it doesn't,
the connection seems to reach the server but it gets stuck there, no
error and it doesn't timeout either...

It really looks like a problem with pg/jdbc and nfs since I did the
same test with our oracle server (running on the same machine as our
pg server) and it worked!

I've also tested the same thing using a user account that doesn't have
is home directory mounted by nfs and it worked!

Any help would be appreciated!

Thanks

Christian


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc and nfs
Date: 2008-02-16 18:19:24
Message-ID: 21927.1203185964@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

"Christian Bourque" <christian(dot)bourque(at)gmail(dot)com> writes:
> The pg server is running on server B (openSUSE) and I'm connecting to
> it from server C (Solaris 10) using a user account with an nfs mounted
> directory from server A (openSUSE).

> If I unmount the nfs share it works! But with the share it doesn't,
> the connection seems to reach the server but it gets stuck there, no
> error and it doesn't timeout either...

It's way too hard to believe that NFS per se is interfering.

What I could believe is that there is some configuration-type file in
your home directory that is causing a problem, and after the unmount
it's not visible so no problem. There are obvious possibilities for
this such as ~/.psqlrc if you're using psql/libpq, but I dunno enough
about the JDBC environment to guess whether it has equivalents.

If all else fails, you could try strace'ing the application (or whatever
Solaris' equivalent to strace is) in both cases and comparing results.
That would at least make it clearer where it's hanging up ...

regards, tom lane


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc and nfs
Date: 2008-02-16 19:43:58
Message-ID: 52EB7A06-120D-4EE2-BE7F-4892EA73D87F@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


On 16-Feb-08, at 1:19 PM, Tom Lane wrote:

> "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com> writes:
>> The pg server is running on server B (openSUSE) and I'm connecting to
>> it from server C (Solaris 10) using a user account with an nfs
>> mounted
>> directory from server A (openSUSE).
>
>> If I unmount the nfs share it works! But with the share it doesn't,
>> the connection seems to reach the server but it gets stuck there, no
>> error and it doesn't timeout either...
>
> It's way too hard to believe that NFS per se is interfering.
>
seems far fetched to me too.

> What I could believe is that there is some configuration-type file in
> your home directory that is causing a problem, and after the unmount
> it's not visible so no problem. There are obvious possibilities for
> this such as ~/.psqlrc if you're using psql/libpq, but I dunno enough
> about the JDBC environment to guess whether it has equivalents.
>
There is no equivalent use in the jdbc environment.

> If all else fails, you could try strace'ing the application (or
> whatever
> Solaris' equivalent to strace is) in both cases and comparing results.
> That would at least make it clearer where it's hanging up ...
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org


From: "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc and nfs
Date: 2008-02-16 19:45:12
Message-ID: a6ee49d30802161145g11af5fddma51d4220bb85a165@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi Tom,

I think you were right, there is something in the home directory that
is conflicting!

I don't understand why jdbc would use something in the user's home
directory though...

Anyway the workaround I found was to not map the share directly under
the user's home account and now it works!

Thanks for your help!

Christian

On Feb 16, 2008 1:19 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com> writes:
> > The pg server is running on server B (openSUSE) and I'm connecting to
> > it from server C (Solaris 10) using a user account with an nfs mounted
> > directory from server A (openSUSE).
>
> > If I unmount the nfs share it works! But with the share it doesn't,
> > the connection seems to reach the server but it gets stuck there, no
> > error and it doesn't timeout either...
>
> It's way too hard to believe that NFS per se is interfering.
>
> What I could believe is that there is some configuration-type file in
> your home directory that is causing a problem, and after the unmount
> it's not visible so no problem. There are obvious possibilities for
> this such as ~/.psqlrc if you're using psql/libpq, but I dunno enough
> about the JDBC environment to guess whether it has equivalents.
>
> If all else fails, you could try strace'ing the application (or whatever
> Solaris' equivalent to strace is) in both cases and comparing results.
> That would at least make it clearer where it's hanging up ...
>
> regards, tom lane
>


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Christian Bourque <christian(dot)bourque(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc and nfs
Date: 2008-02-16 21:09:05
Message-ID: A60EA053-B093-49D2-8EBA-C4E3DC736315@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


On 16-Feb-08, at 2:45 PM, Christian Bourque wrote:

> Hi Tom,
>
> I think you were right, there is something in the home directory that
> is conflicting!
>
> I don't understand why jdbc would use something in the user's home
> directory though...
>
> Anyway the workaround I found was to not map the share directly under
> the user's home account and now it works!
>
My guess is your classpath ?

Dave
> Thanks for your help!
>
> Christian
>
> On Feb 16, 2008 1:19 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com> writes:
>>> The pg server is running on server B (openSUSE) and I'm connecting
>>> to
>>> it from server C (Solaris 10) using a user account with an nfs
>>> mounted
>>> directory from server A (openSUSE).
>>
>>> If I unmount the nfs share it works! But with the share it doesn't,
>>> the connection seems to reach the server but it gets stuck there, no
>>> error and it doesn't timeout either...
>>
>> It's way too hard to believe that NFS per se is interfering.
>>
>> What I could believe is that there is some configuration-type file in
>> your home directory that is causing a problem, and after the unmount
>> it's not visible so no problem. There are obvious possibilities for
>> this such as ~/.psqlrc if you're using psql/libpq, but I dunno enough
>> about the JDBC environment to guess whether it has equivalents.
>>
>> If all else fails, you could try strace'ing the application (or
>> whatever
>> Solaris' equivalent to strace is) in both cases and comparing
>> results.
>> That would at least make it clearer where it's hanging up ...
>>
>> regards, tom lane
>>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


From: "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com>
To: "Dave Cramer" <pg(at)fastcrypt(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc and nfs
Date: 2008-02-17 03:14:51
Message-ID: a6ee49d30802161914n4e389ec2ia1b3f92f5a65a80@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

No it hasn't anything to do with the classpath I've used...

I've investigated the problem a little bit further by profiling my
simple jdbc test class and found out that most of the time is spent in
this class:

sun.security.pkcs11.wrapper.PKCS11.C_Initialize

98% of the time is spent in that function with 3694 calls (well it
will last forever if I don't kill the process)!

So I guess it's a problem with Sun/Solaris security mixed with nfs issue...

Christian

On Feb 16, 2008 4:09 PM, Dave Cramer <pg(at)fastcrypt(dot)com> wrote:
>
> On 16-Feb-08, at 2:45 PM, Christian Bourque wrote:
>
> > Hi Tom,
> >
> > I think you were right, there is something in the home directory that
> > is conflicting!
> >
> > I don't understand why jdbc would use something in the user's home
> > directory though...
> >
> > Anyway the workaround I found was to not map the share directly under
> > the user's home account and now it works!
> >
> My guess is your classpath ?
>
> Dave
> > Thanks for your help!
> >
> > Christian
> >
> > On Feb 16, 2008 1:19 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> "Christian Bourque" <christian(dot)bourque(at)gmail(dot)com> writes:
> >>> The pg server is running on server B (openSUSE) and I'm connecting
> >>> to
> >>> it from server C (Solaris 10) using a user account with an nfs
> >>> mounted
> >>> directory from server A (openSUSE).
> >>
> >>> If I unmount the nfs share it works! But with the share it doesn't,
> >>> the connection seems to reach the server but it gets stuck there, no
> >>> error and it doesn't timeout either...
> >>
> >> It's way too hard to believe that NFS per se is interfering.
> >>
> >> What I could believe is that there is some configuration-type file in
> >> your home directory that is causing a problem, and after the unmount
> >> it's not visible so no problem. There are obvious possibilities for
> >> this such as ~/.psqlrc if you're using psql/libpq, but I dunno enough
> >> about the JDBC environment to guess whether it has equivalents.
> >>
> >> If all else fails, you could try strace'ing the application (or
> >> whatever
> >> Solaris' equivalent to strace is) in both cases and comparing
> >> results.
> >> That would at least make it clearer where it's hanging up ...
> >>
> >> regards, tom lane
> >>
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
>
>