提交 3d1bbb80 编写于 作者: B Baptiste Mathus 提交者: Oleg Nenashev

[JENKINS-53282] "Restarting VM as requested" should be just an INFO message (#3603)

* [JENKINS-53282] "Restarting VM as requested" should be just an INFO message

Previously logged as severe was I think incorrect, as it was simply
reacting on "standard" user interaction.
`INFO` ought to be enough because anyway, that's the default logged level,
hence will still be seen by admins if needed.

Side note: there's clearly duplications of code here.
I might address it later, but do not want to right now transform a 5 min
task into a much riskier one.

* Also lower log severity when shutting down after user request
上级 1832b402
......@@ -4196,7 +4196,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
// give some time for the browser to load the "reloading" page
Thread.sleep(5000);
LOGGER.severe(String.format("Restarting VM as requested by %s",exitUser));
LOGGER.info(String.format("Restarting VM as requested by %s",exitUser));
for (RestartListener listener : RestartListener.all())
listener.onRestart();
lifecycle.restart();
......@@ -4233,7 +4233,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
// give some time for the browser to load the "reloading" page
LOGGER.info("Restart in 10 seconds");
Thread.sleep(10000);
LOGGER.severe(String.format("Restarting VM as requested by %s",exitUser));
LOGGER.info(String.format("Restarting VM as requested by %s",exitUser));
for (RestartListener listener : RestartListener.all())
listener.onRestart();
lifecycle.restart();
......@@ -4280,7 +4280,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
@RequirePOST
public void doExit( StaplerRequest req, StaplerResponse rsp ) throws IOException {
checkPermission(ADMINISTER);
LOGGER.severe(String.format("Shutting down VM as requested by %s from %s",
LOGGER.info(String.format("Shutting down VM as requested by %s from %s",
getAuthentication().getName(), req!=null?req.getRemoteAddr():"???"));
if (rsp!=null) {
rsp.setStatus(HttpServletResponse.SC_OK);
......@@ -4311,7 +4311,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
public void run() {
try {
ACL.impersonate(ACL.SYSTEM);
LOGGER.severe(String.format("Shutting down VM as requested by %s from %s",
LOGGER.info(String.format("Shutting down VM as requested by %s from %s",
exitUser, exitAddr));
// Wait 'til we have no active executors.
doQuietDown(true, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册