Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight change in list admins cache expiry. #583

Merged
merged 1 commit into from
Apr 10, 2019

Conversation

dverdin
Copy link
Contributor

@dverdin dverdin commented Apr 3, 2019

When changing a list's admin two times in the same second, the list admins cache is not updated. Consequently, when trying to add a third admin in the same second, the second one is not in the cache at the time.

Obviously it does not sound like a recurrent scenario and I met this problem when running a test file only.
However, it is possible that this happens more often when trying to make batch modifications in the shell. And also, it made my test fail which is an engineering problem: it could be misguiding about the cause of a test failure.
So I changed the expiration test, replacing "<" by "<=" and it solves the problem.
I don't see any side problem that could result from this change bu I commit it separately anyway because the cache is very sensitive.

…dmins cache is not updated. Consequently, when trying to add a third admin in the same second, the second one is not in the cache at the time.

Obviously it does not sound like a recurrent scenario and I met this problem when running a test file only.
However, it is possible that this happens more often when trying to make batch modifications in the shell. And also, it made my test fail which is an engineering problem: it could be misguiding about the cause of a test failure.
So I changed the expiration test, replacing "<" by "<=" and it solves the problem.
I don't see any side problem that could result from this change bu I commit it separately anyway because the cache is very sensitive.
@ikedas
Copy link
Member

ikedas commented Apr 3, 2019

I feel it's good.
In the future, on-memory cache would be better to be removed.

@dverdin
Copy link
Contributor Author

dverdin commented Apr 3, 2019

Oh really? I thought it was introduced to fix performances problems.
Is it not good enough for this? Do you think there is a better solution?

@racke
Copy link
Contributor

racke commented Apr 3, 2019

The cache caused tons of problems.

@dverdin
Copy link
Contributor Author

dverdin commented Apr 3, 2019

Indeed but I thought it was fixed by now. But then again, I may have missed some conversations.

@racke
Copy link
Contributor

racke commented Apr 3, 2019

We used up a whole package of band aids, but the patient haven't recovered yet 🙄. Caching incorrectly causes more harm than it helps, especially home grown solutions like we got introduced into Sympa.

@dverdin
Copy link
Contributor Author

dverdin commented Apr 4, 2019

That should be a dedicated issue.
So I created one about open discussion regarding cache in Sympa: #584.
The current PR is really a light change in current cache.

@ikedas ikedas merged commit 204e1f9 into sympa-community:sympa-6.2 Apr 10, 2019
@ikedas ikedas added this to the 6.2.44 milestone Apr 10, 2019
@ikedas ikedas added the bug label Apr 10, 2019
@dverdin dverdin deleted the list_admins_cache_change branch April 10, 2019 13:30
@salaun-urennes1 salaun-urennes1 mentioned this pull request May 7, 2020
salaun-urennes1 pushed a commit to salaun-urennes1/sympa that referenced this pull request May 12, 2020
…prevented the cache from being used by _cache_get(). PR sympa-community#583 introduced a bug: most of the time  equals  ; _cache_get() returned undef whereas the data was in cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants