]
Brian Stansberry commented on WFCORE-4018:
------------------------------------------
[~michpetrov] Your point about using 'false' since it's only a read is valid,
but I don't see why that would matter. If two handlers run in the context of a
composite and both call context.getServiceRegistry(true) that should work fine. The
true/false determines whether the thread executing the overall op (the composite) acquires
the exclusive model controller lock, and once it does in one step, later steps have it.
Remove alias and read-aliases in a batch causes blocking behavior
-----------------------------------------------------------------
Key: WFCORE-4018
URL:
https://issues.jboss.org/browse/WFCORE-4018
Project: WildFly Core
Issue Type: Bug
Components: Security
Reporter: Claudio Miranda
Assignee: Michal Petrov
Calling :remove-alias and :read-aliases on key-store resource in a composite operation
makes the resource blocked.
Generate two self signed certificates on a key-store resource and store it.
{code}
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:generate-key-pair(alias=foobar,distinguished-name="cn=claudio,c=BR")
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:generate-key-pair(alias=foobar2,distinguished-name="cn=claudio2,c=BR")
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:store()
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:read-aliases
{
"outcome" => "success",
"result" => [
"foobar2",
"foobar"
]
}
{code}
{code}
batch
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:remove-alias(alias=foobar)
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:read-aliases
run-batch
{code}
The above just blocks the prompt.
Then the blocking operation is show as:
{code}
/host=master/core-service=management/service=management-operations:read-resource(include-runtime,recursive)
{
"outcome" => "success",
"result" => {"active-operation" => {
"352328021" => {
"access-mechanism" => "NATIVE",
"address" => [
("host" => "master"),
("core-service" => "management"),
("service" => "management-operations")
],
"caller-thread" => "management-handler-thread - 1",
"cancelled" => false,
"domain-rollout" => false,
"domain-uuid" => undefined,
"exclusive-running-time" => -1L,
"execution-status" => "executing",
"operation" => "read-resource",
"running-time" => 10032404L
},
"-1467399640" => {
"access-mechanism" => "NATIVE",
"address" => [],
"caller-thread" => "management-handler-thread - 2",
"cancelled" => false,
"domain-rollout" => false,
"domain-uuid" => undefined,
"exclusive-running-time" => -1L,
"execution-status" => "executing",
"operation" => "composite",
"running-time" => 260150849919L
}
}}
}
{code}
After timeout there is the following message on CLI prompt
{code}
The batch failed with the following error (you are remaining in the batch editing mode to
have a chance to correct the error):
WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:
Step: step-2
Operation:
/host=master/server=server-three/subsystem=elytron/key-store=keysto1:read-aliases
Failure: WFLYCTL0409: Execution of operation 'read-aliases' on remote process at
address '[
("host" => "master"),
("server" => "server-three")
]' timed out after 305000 ms while awaiting initial response; remote process has been
notified to terminate operation
{code}
To fix the problem in HAL I will run it as individual commands.