sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #05819
[Bug 1999711] Re: Snmptrapd cannot reconnect to MySQL server after hitting MySQL wait_timeout
Thanks for the updated patches and detailed test case.
For the future, when you are adding the "Origin" tag to the DEP3 header
in the patch, if the fix was merged upstream, please use a commit to the
master/main branch or some other stable reference, instead of a PR.
For this particular case, since the fix was merged, I would have used
this reference instead, for the reconnect patch:
Origin: upstream, https://github.com/net-snmp/net-
snmp/commit/62b2907a46c9e495c1c71114cc8f18ed137b7f34
Tip: with such a reference, github can get you a nice patch file, with
author, subject, etc., by just attaching the string ".patch" to the url,
like so:
https://github.com/net-snmp/net-
snmp/commit/62b2907a46c9e495c1c71114cc8f18ed137b7f34.patch
So it's quite easy to extract a patch from a commit reference if needed.
All of the above is just an observation, no need to update the patches.
For the test plan, please:
a) sanitize it, it has references to outside entities in the example trap. If you can, use a random/standard trap instead of the one you have there which needs sanitizing. Note that OID numbers can refer to company names too.
b) you probably don't need that many VMs to show a working and non-working case, but if you prefer it like that, that's fine. Just be sure that all ubuntu releases are covered in the "working" case.
c) don't use a PPA for the test plan. To show the bug, use the packages currently in Ubuntu, and to show the fix, use the ${release}-proposed pocket.
Once that is done, put the revised test plan in the bug description, in
the [Test Plan] section. If it's still too large for launchpad to show
it nicely, feel free to attach it as a text file and then just refer to
the attachment in the description.
Now a question about the patches. I noticed a difference in the bionic patch, it doesn't have this "#if HAVE_MYSQL_OPTIONS" bit that is present in the other patches:
+#if HAVE_MYSQL_OPTIONS
+ mysql_options(_sql.conn, MYSQL_READ_DEFAULT_GROUP, "snmptrapd");
+#endif
I checked and mysql from bionic (version 5.7) does have this option, so
why is this bit not in the patch? Is this why you marked that patch as a
backport in the origin tag?
https://dev.mysql.com/doc/c-api/5.7/en/mysql-options.html
--
You received this bug notification because you are a member of SE
("STS") Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1999711
Title:
Snmptrapd cannot reconnect to MySQL server after hitting MySQL
wait_timeout
Status in net-snmp package in Ubuntu:
Fix Released
Status in net-snmp source package in Bionic:
In Progress
Status in net-snmp source package in Focal:
In Progress
Status in net-snmp source package in Jammy:
In Progress
Status in net-snmp source package in Kinetic:
In Progress
Status in net-snmp source package in Lunar:
Fix Released
Bug description:
[Impact]
wait_timeout is the number of seconds the MySQL server waits for activity before closing the connection.
MySQL v8.0.24 writes the reason for the connection before closing it, and the client receives a more informative error message (ER_CLIENT_INTERACTION_TIMEOUT).
Snmptrapd does not handle this error code, so the connection will not reconnect to the MySQL server afterward.
[Test Plan]
1. Setup MySQL server and modify wait_timeout to 15 in /etc/MySQL/mysql.conf.d/mysqld.cnf
2. Setup snmptrapd and execute snmptrap command
3. Sleep 15 seconds and re-execute snmptrap command, then the connection will fail until the snmptrapd service restarted
[Where problems could occur]
Once the error happens, snmptrapd will keep the sql commands and resend it after reconnecting to the MySQL server.
The regression can be considered as low.
[Other Info]
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1999711/+subscriptions