[wildfly-dev] Add a warning if some configuration change has wider impact and could cause error?

Jeff Mesnil jmesnil at redhat.com
Fri Jan 6 11:48:11 EST 2017


> On 6 Jan 2017, at 17:24, Brian Stansberry <brian.stansberry at redhat.com> wrote:
> 
> Any opinions? This is basically a proposal to provide a formal way of including warning data in operations responses. 
> 
> If we did it it would probably be something like:
> 
> {
>  “outcome”=>”success”,
>  “result”=>”foo”,
>  “response-headers”=> {
>    “warnings”=[
>        “blah blah blah”,
>       { “some_complex_issue: details”>[“x”,”y”,’z”]}
>    ]
>  }
> }

We had a similar discussion while implementing :migrate operations for legacy subsystems and ended up using a "notification-warnings” parameter in the result node (as opposed to the response-headers node).

> 
> Is that last statement enough reason to add this functionality vs just using the server log to warn, or just not warning at all?

It’s nice to have for sure and would help having a consistent reporting systems in our management clients (we can imagine having flash warnings in the web console and special text in the CLI written to syserr for example).

In an ideal world, I think that any WARN logged in the server console that is caused by a management operation should be reported to the invoker. 
I’d go a step further to constrain the warnings model as a dictionary where each key is a registered logger ID (e.g. XNIO001007) and a value a i18ned string (or a more complex i18ned structure).

Something like:

{
 “outcome”=>”success”,
 “result”=>”foo”,
 “response-headers”=> {
   “warnings” => {
       “XNIO00107” => “some thing happens”,
       “WFCORE1234” => { “some_complex_issue” => [“x”,”y”,’z”]}
   }
 }
}

That’d be very helpful to build our knowledge base and report issues.

> In theory we could use the same facility to report management API deprecation warnings back. Doing that might be annoying though. Those are a less serious problem than this WFCORE-1987 thing.

If you go that way, you could somehow configure the level of reported warnings and let the admin configure the level of reported warnings:

addResponseWarning(String id, int level, String)
addResponseWarning(String id, int level, ModelNode data)

We now have a nice new core-management subsystem where the admin could change the reported warning level (defaulting to something corresponding to serious warnings, as opposed to minor warnings such as API deprecation).

jeff

-- 
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/




More information about the wildfly-dev mailing list