[MXS-4783] Top level services cannot silence errors from lower level services Created: 2023-09-28  Updated: 2024-01-24

Status: Stalled
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 6.4.10, 22.08.8, 23.02.4, 23.08.1
Fix Version/s: 24.08

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

Issue Links:
Blocks
is blocked by MXS-4932 Use GWBUF values in cache filter Closed
Sprint: MXS-SPRINT-193, MXS-SPRINT-196, MXS-SPRINT-197, MXS-SPRINT-198, MXS-SPRINT-199

 Description   

Whenever a service is configured to use another service for routing (i.e. it uses targets), the errors that are logged whenever the connection creation fails are not suppressed even if the upper level service is capable of dealing with them gracefully.

This requires a chage in the routing API to return an error object of some sorts to the caller like is done in 23.08 with the handleError function where the errors are propagated upwards until something handles them or they reach the MXS_SESSION which then terminates the connection.



 Comments   
Comment by markus makela [ 2023-11-03 ]

The way in which errors are propagated to the caller needs to be decided before anything is implemented. Exceptions are an option but they cannot be taken into use without first writing all modules to expect one to be throw in Endpoint::connect(). The refactoring in readwritesplit to use exceptions would make this easier but an overall plan on how to handle this needs to be chosen.

Comment by markus makela [ 2024-01-03 ]

Currently the simplest solution seems to be to throw exceptions from newSession to handle failures. This seems to be about on par with a std::expected approach of returning multiple values except that it can be isolated mostly to the ServiceEndpoint class. A preliminary set of patches can be found here.

The notable changes to the APIs are:

  • mxs::Target::connect() can now throw exceptions.
  • The newSession, routeQuery, clientReply and handleError functions in both filters and routers are allowed to throw exceptions.
Comment by markus makela [ 2024-01-16 ]

Not going to make it into the 24.02 release, still needs review of the exception approach. The commits will continue to be in the develop-markusjm-exceptions branch.

Generated at Thu Feb 08 04:31:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.