[MXS-250] Unsafe error handling Created: 2015-07-07 Updated: 2017-12-01 Resolved: 2017-03-15 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | N/A |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | N/A |
| Type: | New Feature | Priority: | Major |
| Reporter: | martin brampton (Inactive) | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
When an error is such that it is unsafe to continue running, once it has been logged, a simple function call is needed to flush the log files, to record a trace and to terminate the running system. It is probably possible to make existing code serve this purpose. |
| Comments |
| Comment by Dipti Joshi (Inactive) [ 2015-07-07 ] |
|
It is important to identify such errors clearly and carefully. For each error that results into such path - a decision to crash the program intentionally should be reviewed - so that unnecessary crashes are not being created. Usually in C++ you would do this with try/catch - which we do not have due to MaxScale being on C. Having said mechanism can be implemented to handle signals in C. |
| Comment by martin brampton (Inactive) [ 2015-07-07 ] |
|
Mentioning signals is helpful. The desired result can be achieved by raise(SIGABRT) and for this to work the code file will need #include <signal.h> Nobody has suggested that use of crashes wouldn't be carefully considered. (I try to make every design decision carefully). The main two situations where crashing is appropriate are:
There is another major issue, which needs to be resolved. There are numerous situations in the code where errors (such as out of memory) are detected in functions that pass back e.g. NULL as an error return, but where calling functions do not check for this. The result will be unpredictable behaviour in the event of failures, which is highly undesirable and produces bugs that are hard to pin down. This issue is therefore broadened to include such problems. |
| Comment by Dipti Joshi (Inactive) [ 2015-07-07 ] |
|
Before this is implemented - a group review of the design should be done. |
| Comment by Johan Wikman [ 2017-03-15 ] |
|
Too general and vague. |