The loop continues because Indy exceptions are not handled correctly.
Either remove the exception handler, or rerun the exception after logging:
except
on e : Exception do
begin
MainForm.Log('error in Execute=' + e.Message);
raise;
end;
end;
p.s. MainForm . (TThread.Queue ).