1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00
pgbackrest/doc/xml
David Steele 0f7b6a3344
Skip mem context cleanup in CATCH_FATAL() block.
An error that gets raised all the way to the top TRY block might need to free a lot of resources and any of these callbacks could throw an error and mask the original error. In fact this is pretty likely since we are already in an error state. For example, the Db object will try to close the remote db connection, but if the protocol is in a bad state it will not be able to do so.

Solve this, for now, by not freeing memory or calling callbacks in the CATCH_FATAL() block. This gives us a better chance if being able to report the error without encountering another error first.

For the most part, we don't need to worry about freeing resources (file handles, TLS contexts, etc.) if the program is going to exit immediately. However, it is important to attempt to terminate all active protocol connections, which is done by protocolFree() in main() since the protocol objects live in the top context.

Another way to handle this would be to implement an error stack and that is probably something we will do in the future. But, in the case of a segfault the original error would still be lost. Yet another option would be to still do cleanup but defer it until after the CATCH_FATAL() block.
2022-08-31 12:44:55 -04:00
..
auto v2.40: OpenSSL 3 Support 2022-07-18 09:32:30 -04:00
dtd Add br tag for documentation. 2022-05-11 10:39:31 -04:00
coding.xml Clean up dividers in the documentation. 2022-05-06 12:11:04 -04:00
contributing.xml Add experimental Meson build. 2022-06-03 14:13:56 -04:00
documentation.xml Clean up dividers in the documentation. 2022-05-06 12:11:04 -04:00
faq.xml Add FAQ about backup types and restore speed. 2022-05-10 14:17:05 -04:00
index.xml Clean up dividers in the documentation. 2022-05-06 12:11:04 -04:00
metric.xml Clean up dividers in the documentation. 2022-05-06 12:11:04 -04:00
release.xml Skip mem context cleanup in CATCH_FATAL() block. 2022-08-31 12:44:55 -04:00
user-guide-index.xml Simplify messaging around supported versions in the documentation. 2022-05-09 11:59:08 -04:00
user-guide.xml Backup key/value annotations. 2022-08-24 10:52:33 -04:00