Skip to content

Commit

Permalink
Fix #8536 HotSwap start race
Browse files Browse the repository at this point in the history
Don't stop until after new handler installed.
  • Loading branch information
gregw committed Sep 3, 2022
1 parent f2e9744 commit 7087dd0
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ public void setHandler(Handler handler)
try
{
Server server = getServer();
if (handler == _handler)
return;

Handler oldHandler = _handler;
if (handler != null)
{
handler.setServer(server);
updateBean(_handler, handler, true);
addBean(handler, true);
if (oldHandler != null && oldHandler.isStarted())

This comment has been minimized.

Copy link
@elipsion

elipsion Sep 6, 2022

You're going to run into a corner case where this.isStarted() == true and oldHandler == null, causing the new handler to remain stopped.
During those conditions I'd still expect the new handler to be started.

handler.start();
}
_handler = handler;
if (oldHandler != null)
removeBean(oldHandler);
}
catch (Exception e)
{
Expand Down

0 comments on commit 7087dd0

Please sign in to comment.