powered by Jive Software

Question about caching in UserManager

Hi! I have a question about the user caching in the UserManager class. It looks like the usersCache is the cache of local users, which is pretty straightforward. When a user is created, the new user is added to the cache. However, the new user is -not- added to the registeredUsersCache. I’‘m seeing a problem due to this, and I’‘m wondering if this is a bug in Wildfire or if there’‘s a better way to do what I’‘m trying to do. What I’‘m trying to do is have users created dynamically when people log in to the server for the first time. Here’‘s the scenario that creates the problem I’'m seeing:

  1. initial state: user ‘‘example’’ does not exist yet

  2. a request is made to the presence plugin for the presence of user ‘‘example’’

  3. during the handling of this request, a FALSE is put into the registeredUsersCache for ‘‘example’’

  4. user ‘‘example’’ logs in, and in a custom AuthProvider, a call is made to UserManager.createUser() to create ‘‘example’’

At this point, the ‘‘example’’ user -is- in the usersCache, but ‘‘example’’ maps to FALSE in the registeredUsersCache, which winds up causing some funky behavior (like packets not being delivered). Should a TRUE be put in the registeredUsersCache when the user is created to avoid this issue?

Whoops, I didn’‘t mean to mark this thread as a question but I got interrupted after I posted it and wasn’'t able to get back in time to un-mark the thread.

Hey Sam,

Interestingly your first post starts saying that you have a question.

Which Wildfire version are you using? That problem was fixed in Wildfire 2.6.2 and the related issue was JM-642. In fact, the variable registeredUsersCache was renamed to remoteUsersCache to only cache info about remote users.

Regards,

– Gato

I’'m using v2.5.1 still at this point. The 2.6.2 code does look like it fixes the problem, giving me another good reason to upgrade.

On a side note I guess I’‘m not entirely sure I understand the point of the whole “mark as a question” feature and I thought maybe my post wasn’'t the right kind of question to mark as a question. Anyway, thanks for the answer.