[MDEV-32341] Log connection attributes in server errors that relate to clients Created: 2023-10-03  Updated: 2023-10-12

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: markus makela Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Whenever a client unexpectedly disconnects (e.g in the middle of a query), log the connection attributes in any error messages. This should help identify which client error relates to which server error. In some cases (e.g. with Python ORM frameworks like SQLAlchemy) getting the connection ID is actually very hard. Any other identifying information in this case would help identify possible sources of the error.



 Comments   
Comment by Sergei Golubchik [ 2023-10-12 ]

This is a good idea. But not exactly clear how to present this in the error log.
We cannot just put all the connection attributes into the error line.
Print them all on a line before or after?
Print them one attribute per line before or after the error line?
Let the user configure what to show?
I generally prefer line-oriented log, spreading the information over many lines complicates parsing. But I don't see how it could be do it here.

Comment by markus makela [ 2023-10-12 ]

My personal interest is in the "reserved" attributes i.e. OS, driver name, PID. A line-oriented log is definitely easier to deal with and if the number of attributes is limited to the reserved ones, it should not be that long.

Generated at Thu Feb 08 10:30:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.