sympa-community / sympa

Sympa, Mailing List Management Software
https://www.sympa.community/sympa
GNU General Public License v2.0
237 stars 94 forks source link

Warn list owner/listmaster when a high number of list member are deleted in dynamic lists #1855

Closed qosobrin closed 1 week ago

qosobrin commented 2 weeks ago

At our institution, we manage numerous lists that utilize dynamic subscription from databases. Occasionally, queries to the database fail, resulting in incomplete member updates and subsequent removals from the lists. These member deletions are reflected in the Sympa log file:

Jun 6 09:41:34 hostname task_manager[1308676]: info Sympa::Request::Handler::include::_twist() Sympa::Request <action=include;context=list@domain;role=member>: Success, 0 added, 4057 deleted, 2652 updated

I am exploring methods to receive alerts for dynamic subscription lists when a significant number or percentage of list members are removed.

Version

Sympa 6.2.70

Installation method

Debian 12 package

Expected behavior

If a large number or high percentage of list members is removed from a dynamic list, the listmaster or list owner should receive a warning. If this feature is not currently available, it would be a valuable feature to be added.

Actual behavior

Nothing is reported; only sympa.log records the deletion of this number of members.

ikedas commented 2 weeks ago

Hi @qosobrin , Could you please show us the query itself that failed and the logs indicating that that query failed?

qosobrin commented 2 weeks ago

Hi @qosobrin , Could you please show us the query itself that failed and the logs indicating that that query failed?

It was a problem with the database itself. The query was OK since we had been using it for months and it worked after I forced a member synchronization. We were changing the table scheme when Sympa started a member synchronization, so it got an empty set.

ikedas commented 2 weeks ago

Could you please show us the logs indicating that that database failed?

If you couldn't, since there is no way to detect abnormal behavior, I think that there is nothing Sympa can do about it.

qosobrin commented 2 weeks ago

Sorry, @ikedas, but the point in my question is not the database problem, forget that. I want to know if sympa has a way to detect when the number of members of a dynamic list changes drastically and alert the lismaster/list owner about it. If not, could this feature be considered to be added?

ikedas commented 2 weeks ago

For example, the school's class lists would change "drastically" at the time students graduate. Or, it could happen that a particular data source would get an empty set. There is no general standard by which these things can be judged as anomalies.

If your institution want to detect "abnormal" behavior based on your own criteria, why don't you monitor the logs and make a determination based on the numbers that appear in the lines of the logs?

qosobrin commented 1 week ago

OK, we will do it. Thank you for your answer, @ikedas. I still think this can be a nice feature.