Skip to contentSkip to conversation

Optionally abort on internal errors.

PATCH New Petr Rockai 3 participants 4 messages Nov 29, 2009 – Nov 30, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Optionally abort on internal errors.

Hi,

a fairly straightforward patch adding a configure option that will abort() the process in case it encounters an internal error. Undocumented so far and not sure it's appropriate to expose -- but maybe we have a policy of no undocumented options?

Anyway, patch attached. (It also makes the testsuite set this option, so it'll catch any internal errors that may happen during the tests.)

Yours,
Petr.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: internal-errors.diff
Type: text/x-diff
Size: 3081 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20091129/c5c559a0/attachment.bin>

#1 lore raw

PATCH 1/1 Optionally abort on internal errors.

Quoted 4 lines · Petr Rockai

a fairly straightforward patch adding a configure option that will abort() the process in case it encounters an internal error. Undocumented so far and not sure it's appropriate to expose -- but maybe we have a policy of no undocumented options?

I like that idea, very useful for test suite.

ACK from me.

just some nitpicking changes like

+ if (level <= _LOG_ERR && !strncmp(format, "Internal error:",
+ strlen("Internal error:")))
(why strlen? just len or better #define the string)

- should it be in log section (global?)

- maybe only activate that when in debug (verbose mode)?

Milan

#2 lore raw

PATCH 1/1 Optionally abort on internal errors.

Quoted 3 lines · Milan Broz
(quoted diff) +2 -0
+	if (level <= _LOG_ERR && !strncmp(format, "Internal error:",
+					  strlen("Internal error:")))

(why strlen? just len or better #define the string)

#define LOG_INTERNAL_ERR "Internal error: "

These messages may occur at any log level.
In normal circumstances not all of them prevent the program proceeding, but all should be fatal if this option is set.

Quoted 1 line

- maybe only activate that when in debug (verbose mode)?

Too confusing. Control via --config should be sufficient for now.

Alasdair

#3 lore raw

PATCH 1/1 Optionally abort on internal errors.

In reply to Petr Rockai
Quoted 4 lines · Peter Rockai

a fairly straightforward patch adding a configure option that will abort() the process in case it encounters an internal error. Undocumented so far and not sure it's appropriate to expose -- but maybe we have a policy of no undocumented options?

It should be added to docs/example.conf at the end of the global section. (The connection with 'log' is only an implementation detail - conceptually it's a 'global' option.)

Ack.

Alasdair