Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.7.2
-
Component/s: Notifications
-
Labels:None
Description
Steps to reproduce:
- Set MySQL wait_timeout to a short value: SET @@GLOBAL.wait_timeout=10;
- Start SonarQube server
- Send a first notification (update an issue) => session is opened and attached to NotificationService thread
- Wait for 10 seconds until idle connection is closed by MySQL server
- Try to send another notification => NotificationService try to reuse same previous session but underlying connection is closed => error
WARN o.s.s.n.NotificationService Unable to deliver notification Notification [...] Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 181ÃÂ 088 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
In real life it occurs when the NotificationManager didn't send email in a period exceeding MySQL wait_timeout.
There is an easy fix that is to always close session after each execution of the NotificationService. This way during next "wake-up" of the NotificationService a fresh new session will be created and a new connection requested from the pool.
Attachments
Issue Links
- is related to
-
SONAR-6566 Unable to deliver notifications on MySQL
-
- Closed
-