| Issue 2106: | Plugins: LifecycleListener's start() and stop() are called twice | |
| 2 people starred this issue and may be notified of changes. | Back to list |
************************************************************ ***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW ***** ***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL ***** ***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC. ***** ***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS! ***** ************************************************************ Affected Version: master What steps will reproduce the problem? 1. Make a plugin implement LifecycleListener 2. Output something to the error log in the start() and stop() methods 3. What is the expected output? What do you see instead? Expected behaviour: start() and stop() are called once when the server starts and shuts down, respectively. Actual behaviour: start() and stop() are called twice. Please provide any additional information below. See the log output from testing with [1]. [2013-09-05 18:13:18,051] ERROR com.googlesource.gerrit.plugins.validators.CommitMessageLengthValidation : commit validation plugin start [2013-09-05 18:13:18,051] ERROR com.googlesource.gerrit.plugins.validators.CommitMessageLengthValidation : commit validation plugin start [2013-09-05 18:13:18,052] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin commit-message-length-validator [2013-09-05 18:13:40,600] INFO com.google.gerrit.server.plugins.PluginLoader : Unloading plugin commit-message-length-validator [2013-09-05 18:13:40,600] ERROR com.googlesource.gerrit.plugins.validators.CommitMessageLengthValidation : commit validation plugin stop [2013-09-05 18:13:40,600] ERROR com.googlesource.gerrit.plugins.validators.CommitMessageLengthValidation : commit validation plugin stop [1] https://gerrit-review.googlesource.com/#/c/49505/1
Sep 5, 2013
Project Member
#1
edwin.ke...@gmail.com
Sep 6, 2013
I'm not sure if that's right. I don't have the code in front of me right now, but as far as I remember the commit message check plugin does not provide either http or ssh module.
Nov 13, 2013
David is right, I created an empty plugin without any module and only a LifecycleListener and the start/stop were called twice. Start/stop are only called twice when the LifecycleListener is automatically registered using the @Listen annotation. To work-around the issue: I created a LifecycleModule to explicitly register my LifecycleListener using the following line: listener().to(YourLifecycleListener.class); |
|
| ► Sign in to add a comment |