Bug 1525569

Summary: PostConstruct of Backend is recursively invoked
Product: [oVirt] ovirt-engine Reporter: Ravi Nori <rnori>
Component: Backend.CoreAssignee: Ravi Nori <rnori>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hrazdil <rhrazdil>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: bugs, lsvaty, lveyde, mperina
Target Milestone: ovirt-4.2.1Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.1.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-12 11:54:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server.log none

Description Ravi Nori 2017-12-13 15:22:40 UTC
Created attachment 1367437 [details]
server.log

Description of problem: On engine startup invoking compensate on unhandled commands during Backend postConstruct causes circular dependency on Backend. The problem arises when the command has Singleton injected whose postConstruct invokes methods on Backend.
    
An example is RunVmCommand that has HostDeviceManager injected. HostDeviceManager's postConstruct uses backend's runInternalMultipleActions causing a circular dependency.
    
Moving compensate after backend is initialized would avoid such issues.

How reproducible:


Steps to Reproduce:
1. Have multiple VMs
2. Toggle state of VM using python sdk
3. Shutdown engine while the python script is running
4. Start engine

Actual results:

The server log has javax.ejb.EJBException: java.lang.IllegalStateException: WFLYEJB0132: @PostConstruct method of EJB singleton Backend of type org.ovirt.engine.core.bll.Backend has been recursively invoked

Expected results:

No exception should be shown

Comment 1 Radim Hrazdil 2018-01-30 15:34:29 UTC
Verified by issuing the following:
1. Toggled several VMs to start using Python SDK 4.2.4
2. systemctl stop ovirt-engine.service on the engine
3. started engine
4. checked engine.log for exception in the description

The exception wasn't found in the engine.log.
RHV 4.2.1.3-0.1.el7
pythonsdk 4.2.4

Comment 2 Sandro Bonazzola 2018-02-12 11:54:40 UTC
This bugzilla is included in oVirt 4.2.1 release, published on Feb 12th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.1 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.