Bug 1010524 - batch not verified for correctness
batch not verified for correctness
Status: NEW
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
Assigned To: Alexey Loubyansky
Petr Kremensky
Depends On:
  Show dependency treegraph
Reported: 2013-09-21 03:21 EDT by Aleksandar Kostadinov
Modified: 2017-10-09 20:20 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Enhancement
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Aleksandar Kostadinov 2013-09-21 03:21:53 EDT
> batch 
> /subsystem=web/connector=https:add(enabled="true", secure="true", enableLookups="false", scheme="https", disableUploadTimeout="true", maxThreads="150", maxHttpHeaderSize="8192", SSLCertificateFile="/tmp/www.example.com.cert", SSLCertificateKeyFile="/tmp/www.example.com.key", socket-binding="https", protocol="HTTP/1.1", SSLEnabled="true")
> run-batch

This is an incorrect command within the batch but its outcome is success. Unknown parameters are simply ignored.

If the same command is executed outside a batch, then it properly fails with an error telling there are unknown parameters.
Comment 3 Alexey Loubyansky 2013-10-04 11:13:07 EDT
True, commands in batches are not validated. There is a reason for that though. Some commands in a batch may depend on the preceding commands in the same batch, i.e. the results of those commands. For example, some addresses may not actually exist when the command is added to the batch but they will during the execution. If we start validating commands then either many of them will fail or we'd have to somehow take into account the effect of the preceding commands on the management model (which, in general, won't be possible on the client side).

The batch execution succeeds because the server side doesn't verify arguments. I.e. some argument values are validated when they are recognized. But unrecognized arguments are generally simply ignored.

So, it's not an easy one in a sense that general validation rules can't be applied to the commands added to batches.
Comment 4 Aleksandar Kostadinov 2013-10-04 12:21:27 EDT
Wouldn't it be good if we have that validation on server side? I think it's better if user gets feedback when there is unknown parameter supplied. A small typo could otherwise have subtle effects because user won't know there was a typo until something breaks.
Comment 5 Alexey Loubyansky 2013-10-04 15:56:58 EDT
It would. But given that it hasn't been a common practice from the beginning it'd be quite an effort to implement now. The model provides the descriptions of what it supports and delegates the validation to the tools. This is where it fails. I mean, for this specific example reported in the issue, I could get the operation description and check the parameters (because the path exists from the beginning). But if the batch would be something like:


I might not be able to get the description of some-op (and, hence, validate its parameters) until the path to d exists.
Comment 6 Alexey Loubyansky 2014-07-17 05:02:53 EDT
I am changing the type to Enhancement since what is originally described is the expected behavior, although unfortunately.

Note You need to log in before you can comment on or make changes to this bug.