Fix serial console worker blocking Nova

The worker used by Nova to log instance serial console output can
log an exception message.

The issue is that logging a message from a different thread causes
Nova to hang. It seems that the logging file handler causes issues
when greenthreads and multiple native threads are used at the same,
and the native threads log messages.

This patch removes this log message for now. In the future, we
should fix the logging handler to avoid this issue.

NOTE: This issue has already been solved in Mitaka in os-win,
which the Hyper-V driver uses since Mitaka.

(cherry picked from commit a25959a204f365a532138d7fe0a73b4cd039e807)

Change-Id: Ia5c1aba28347648e90f5ba6111fc047d711236db
Closes-Bug: #1557498
This commit is contained in:
Lucian Petrut 2016-05-10 17:06:02 +03:00 committed by Claudiu Belu
parent 87f47a84ad
commit 3a713f8bf4
1 changed files with 1 additions and 9 deletions

View File

@ -13,14 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import errno
import os
from eventlet import patcher
from oslo_log import log as logging
from nova.i18n import _LE
LOG = logging.getLogger(__name__)
native_threading = patcher.original('threading')
@ -39,13 +36,8 @@ class IOThread(native_threading.Thread):
def run(self):
try:
self._copy()
except IOError as err:
except Exception:
self._stopped.set()
# Invalid argument error means that the vm console pipe was closed,
# probably the vm was stopped. The worker can stop it's execution.
if err.errno != errno.EINVAL:
LOG.error(_LE("Error writing vm console log file from "
"serial console pipe. Error: %s") % err)
def _copy(self):
with open(self._src, 'rb') as src: