Alissa Bonas has posted comments on this change. Change subject: core: Locate data source in a loop ......................................................................
Patch Set 1: I would prefer that you didn't submit this (1 inline comment) .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacadeLocator.java Line 51: "check it. Will try again in a few seconds."); Line 52: Line 53: // Wait a bit before trying again: Line 54: Thread.sleep(DEFAULT_INTERVAL_VALUE); Line 55: } Doing logic inside a static block is very problematic in general. If the static block fails, it usually leads to NoClassDefFoundError which are very hard to investigate and solve. If the static block takes a lot of time - then it will be problematic to use the class because it won't be initialized in timely manner. Using an infinite loop and a Thread.sleep inside this static block is even more dangerous - what if the infinite loop never exits? Will this class be never properly initialized? (and using an infinite loop generally speaking is not a good idea even not in static initialization block) . Waiting for ejb to init in static block and condition class startup on it - very shaky solution. Imagine some cases when application fails to deploy or fails to startup due to this static block - how will someone troubleshoot it and realize that DNS and this static block are the problematic issue? Line 56: Line 57: // Create the facade and return it: Line 58: dbFacade = new DbFacade(); Line 59: dbFacade.setDbEngineDialect(loadDbEngineDialect()); -- To view, visit http://gerrit.ovirt.org/10189 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72c99c61d05e8a1619c7d1fb70af956d1050eb3a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Alissa Bonas <abo...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches