You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Rich Remington <ri...@remingtons.us> on 2008/09/12 15:02:39 UTC
weird caching behavior?
I am curious is there is an article/example that describes how to deal
with the following scenario:
1. User logs into webapp that uses Spring Security (v2.0.3) backed by
Apache DS 1.0.2.
2. Webapp (via an ESB service) changes password in LDAP
- using Apache Dir Studio (v1.1.0), I can see the password has
changed in the directory
3. After a logout from webapp, a quick attempt to login with new
password fails, but using the old password works.
It turns out that I need to reboot Apache DS to affect the password
change in the webapp. A reboot of the webapp after step 3 has no affect.
Thanks,
Rich
Re: weird caching behavior?
Posted by Emmanuel Lecharny <el...@gmail.com>.
Rich Remington wrote:
> Okay, for those who are on the edge of their seats waiting to find out
> the answer whether an upgrade fixed the issue I was experiencing...
> The answer is a definite yes - for now! We still need to test some
> more scenarios, but this still begs the question as to why I was
> seeing this behavior in version 1.0.2. At least I am able to move
> ahead, now.
>
> And, to answer your question below about binding with the new password
> using Studio: No, I was not able to bind with the new password using
> Studio or the webapp - even though I can see the new password value
> (for the user whose password was changed) when logged in as the admin
> user, so it appears this is an issue inside the (version 1.0.2) LDAP
> server.
Thanks for having spent some time to switch, and to test it. It sounds
like a real bug in 1.0.2. However, I don't think we will fix it, as we
consider the 1.0 branch almost dead : we have put so much energy in 1.5
that spending time fixing 1.0 would be like trying to heal a dead man ...
Thanks for your patience !
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: weird caching behavior?
Posted by Rich Remington <ri...@remingtons.us>.
Okay, for those who are on the edge of their seats waiting to find out
the answer whether an upgrade fixed the issue I was experiencing... The
answer is a definite yes - for now! We still need to test some more
scenarios, but this still begs the question as to why I was seeing this
behavior in version 1.0.2. At least I am able to move ahead, now.
And, to answer your question below about binding with the new password
using Studio: No, I was not able to bind with the new password using
Studio or the webapp - even though I can see the new password value (for
the user whose password was changed) when logged in as the admin user,
so it appears this is an issue inside the (version 1.0.2) LDAP server.
HTH,
Rich
Emmanuel Lecharny wrote:
> Rich Remington wrote:
>> I am using the standalone server. BTW, the password is seen right
>> after the change AND after a reboot of the standalone server, so the
>> password change is permanent - even if not written to disk
>> immediately. The problem still remains that between the time it is
>> changed by the webapp and before the reboot of the LDAP server,
>> webapp attempts to bind with the new password fail, but binding with
>> the old password works.
> And you can bind with the new password using Studio ?
>>
>> Weird...
>>
>> I will upgrade to 1.5.4 in the meantime and let you know if this is
>> fixed. Are there any config migration tools and/or tips? Will LDIF
>> export/import just work?
> 1.5.4 has been released, and is available. Export and re-import using
> LDIF, there is no other way atm. (be carefull : if you have changed
> the schema, then you have to modify it on the new version)
>
>
Re: weird caching behavior?
Posted by Emmanuel Lecharny <el...@gmail.com>.
Rich Remington wrote:
> I am using the standalone server. BTW, the password is seen right
> after the change AND after a reboot of the standalone server, so the
> password change is permanent - even if not written to disk
> immediately. The problem still remains that between the time it is
> changed by the webapp and before the reboot of the LDAP server, webapp
> attempts to bind with the new password fail, but binding with the old
> password works.
And you can bind with the new password using Studio ?
>
> Weird...
>
> I will upgrade to 1.5.4 in the meantime and let you know if this is
> fixed. Are there any config migration tools and/or tips? Will LDIF
> export/import just work?
1.5.4 has been released, and is available. Export and re-import using
LDIF, there is no other way atm. (be carefull : if you have changed the
schema, then you have to modify it on the new version)
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: weird caching behavior?
Posted by Rich Remington <ri...@remingtons.us>.
I am using the standalone server. BTW, the password is seen right after
the change AND after a reboot of the standalone server, so the password
change is permanent - even if not written to disk immediately. The
problem still remains that between the time it is changed by the webapp
and before the reboot of the LDAP server, webapp attempts to bind with
the new password fail, but binding with the old password works.
Weird...
I will upgrade to 1.5.4 in the meantime and let you know if this is
fixed. Are there any config migration tools and/or tips? Will LDIF
export/import just work?
Thanks for all your insight so far!
Rich
Emmanuel Lecharny wrote:
> Rich Remington wrote:
>> Thanks for the feedback! It appears that I need to try the upgrade
>> as I do have the synchOnWrite=true already. Where can I find 1.5.4
>> today?
> You can't, as the mirror are just being updated, and it takes time. As
> soon as the mirrors will be ok, we will update the download pages.
>
> However, you can build the installer for your platform from the code :
> http://directory.apache.org/apacheds/1.5/building-trunks.html#Buildingtrunks-Buildingtheinstallers
>
>>
>> Also, I am still confused about the scenario I am experiencing. The
>> webapp is the one responsible for making the password change, which
>> is then seen by the Studio app right afterward.
> The webapp will transmit the new password to the LDAP server, which is
> responsible for the password storage. And the LDAP server 'sees' the
> password, as you can check it with Studio.
>> So, if the cache has the change, it seems that the cache should be
>> used for future bind requests by either the webapp or Studio.
> The cache will be used, that's for sure.
>> It really shouldn't matter if it has hit the disk yet, should it?
> It does, because if the password is just in the cache, and not on the
> disk, when you shutdown the webapp (thus the LdapServer), the password
> just disappear...
>
> Are you embedding the server in your webapp, btw ?
>
Re: weird caching behavior?
Posted by Emmanuel Lecharny <el...@gmail.com>.
Rich Remington wrote:
> Thanks for the feedback! It appears that I need to try the upgrade as
> I do have the synchOnWrite=true already. Where can I find 1.5.4 today?
You can't, as the mirror are just being updated, and it takes time. As
soon as the mirrors will be ok, we will update the download pages.
However, you can build the installer for your platform from the code :
http://directory.apache.org/apacheds/1.5/building-trunks.html#Buildingtrunks-Buildingtheinstallers
>
> Also, I am still confused about the scenario I am experiencing. The
> webapp is the one responsible for making the password change, which is
> then seen by the Studio app right afterward.
The webapp will transmit the new password to the LDAP server, which is
responsible for the password storage. And the LDAP server 'sees' the
password, as you can check it with Studio.
> So, if the cache has the change, it seems that the cache should be
> used for future bind requests by either the webapp or Studio.
The cache will be used, that's for sure.
> It really shouldn't matter if it has hit the disk yet, should it?
It does, because if the password is just in the cache, and not on the
disk, when you shutdown the webapp (thus the LdapServer), the password
just disappear...
Are you embedding the server in your webapp, btw ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: weird caching behavior?
Posted by Pierre-Arnaud Marcelot <pa...@marcelot.net>.
Hi Rich,
On Fri, Sep 12, 2008 at 7:50 PM, Rich Remington <ri...@remingtons.us> wrote:
> Thanks for the feedback! It appears that I need to try the upgrade as I do
> have the synchOnWrite=true already. Where can I find 1.5.4 today?
Until the release gets synced on all the mirrors, you can find it here:
http://people.apache.org/~akarasulu/apacheds/1.5.4/
Regards,
Pierre-Arnaud
Re: weird caching behavior?
Posted by Rich Remington <ri...@remingtons.us>.
Thanks for the feedback! It appears that I need to try the upgrade as I
do have the synchOnWrite=true already. Where can I find 1.5.4 today?
Also, I am still confused about the scenario I am experiencing. The
webapp is the one responsible for making the password change, which is
then seen by the Studio app right afterward. So, if the cache has the
change, it seems that the cache should be used for future bind requests
by either the webapp or Studio. It really shouldn't matter if it has
hit the disk yet, should it?
Cheers,
Rich
Emmanuel Lecharny wrote:
> Rich Remington wrote:
>> I am running Mac OSX. The file system write issue does not make
>> sense to me if I can see the change has occurred using Apache Dir
>> Studio before the reboot.
> The problem is that you are still hitting the cache :) So it does not
> prove anything ...
>> I *could* try the upgrade to 1.5.3, but *should* I? How stable is
>> that version compared to 1.5.3?
> We are just releasing 1.5.4 today (the announcement is not yet done,
> but will be tomorrow). So, yes, you *should*, becuase 1.5.x is way
> better than 1.0.x.
>>
>> Just a thought... if the webapp (Spring Security) pools the
>> connection and keeps it alive with the old password, could that
>> explain the scenario?
> Hmmmm. I don't know... If you stop the server, start it again, and you
> don't see the password using Studio, then that mean the password has
> not been saved on disk.
>> I am not positive that a new bind request is actually flowing to
>> Apache DS - can I see all bind attempts in the log file?
> You have to set the logs to the correct level to get such an information.
>
Re: weird caching behavior?
Posted by Emmanuel Lecharny <el...@gmail.com>.
Rich Remington wrote:
> I am running Mac OSX. The file system write issue does not make sense
> to me if I can see the change has occurred using Apache Dir Studio
> before the reboot.
The problem is that you are still hitting the cache :) So it does not
prove anything ...
> I *could* try the upgrade to 1.5.3, but *should* I? How stable is
> that version compared to 1.5.3?
We are just releasing 1.5.4 today (the announcement is not yet done, but
will be tomorrow). So, yes, you *should*, becuase 1.5.x is way better
than 1.0.x.
>
> Just a thought... if the webapp (Spring Security) pools the connection
> and keeps it alive with the old password, could that explain the
> scenario?
Hmmmm. I don't know... If you stop the server, start it again, and you
don't see the password using Studio, then that mean the password has not
been saved on disk.
> I am not positive that a new bind request is actually flowing to
> Apache DS - can I see all bind attempts in the log file?
You have to set the logs to the correct level to get such an information.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: weird caching behavior?
Posted by Rich Remington <ri...@remingtons.us>.
I am running Mac OSX. The file system write issue does not make sense
to me if I can see the change has occurred using Apache Dir Studio
before the reboot. I *could* try the upgrade to 1.5.3, but *should* I?
How stable is that version compared to 1.5.3?
Just a thought... if the webapp (Spring Security) pools the connection
and keeps it alive with the old password, could that explain the
scenario? I am not positive that a new bind request is actually flowing
to Apache DS - can I see all bind attempts in the log file? Has anyone
else seen this with Spring Security or pooling of LDAP connections?
Thanks!
Rich
Emmanuel Lecharny wrote:
> Rich Remington wrote:
>> I am curious is there is an article/example that describes how to
>> deal with the following scenario:
>>
>> 1. User logs into webapp that uses Spring Security (v2.0.3) backed by
>> Apache DS 1.0.2.
>> 2. Webapp (via an ESB service) changes password in LDAP
>> - using Apache Dir Studio (v1.1.0), I can see the password has
>> changed in the directory
>> 3. After a logout from webapp, a quick attempt to login with new
>> password fails, but using the old password works.
>>
>> It turns out that I need to reboot Apache DS to affect the password
>> change in the webapp. A reboot of the webapp after step 3 has no
>> affect.
> You have to check that the files handling the data are written on
> disk. You may have pb with your file system writes. Otherwise, there
> is a cache, yes, but you can tell the server to sync on write (there
> is a flag in the partition configuration : <property
> name="synchOnWrite" value="true" />).
>
> It may also be a bug in ADS 1.0.2...
>
Re: weird caching behavior?
Posted by Emmanuel Lecharny <el...@gmail.com>.
Rich Remington wrote:
> I am curious is there is an article/example that describes how to deal
> with the following scenario:
>
> 1. User logs into webapp that uses Spring Security (v2.0.3) backed by
> Apache DS 1.0.2.
> 2. Webapp (via an ESB service) changes password in LDAP
> - using Apache Dir Studio (v1.1.0), I can see the password has
> changed in the directory
> 3. After a logout from webapp, a quick attempt to login with new
> password fails, but using the old password works.
>
> It turns out that I need to reboot Apache DS to affect the password
> change in the webapp. A reboot of the webapp after step 3 has no affect.
You have to check that the files handling the data are written on disk.
You may have pb with your file system writes. Otherwise, there is a
cache, yes, but you can tell the server to sync on write (there is a
flag in the partition configuration : <property name="synchOnWrite"
value="true" />).
It may also be a bug in ADS 1.0.2...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org