[
https://issues.apache.org/jira/browse/IMPALA-8747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16882507#comment-16882507
]
ASF subversion and git services commented on IMPALA-8747:
---------------------------------------------------------
Commit 0fedc1f97f9571e59b8b1dc3ed963d44d9ac3f03 in impala's branch
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=0fedc1f ]
IMPALA-8747: Fix string formatting on HS2 connection setup failure
In impala_test_suite.py, the logging for HS2 connection failure
uses "{0}" replacement codes when the logging facility expects it
to use "%"-style codes. This fixes it to call .format() directly.
Change-Id: I4789712fcd71c887a9c6c890cd22a4f382faa3a5
Reviewed-on: http://gerrit.cloudera.org:8080/13815
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> ImpalaTestSuite::setup_class() can hit TypeError on HS2 connection setup
> failure
> --------------------------------------------------------------------------------
>
> Key: IMPALA-8747
> URL: https://issues.apache.org/jira/browse/IMPALA-8747
> Project: IMPALA
> Issue Type: Bug
> Components: Infrastructure
> Affects Versions: Impala 3.3.0
> Reporter: Joe McDonnell
> Assignee: Joe McDonnell
> Priority: Critical
> Labels: broken-build
>
> If we reach this exception handler in tests/common/impala_test_suite.py:
> {code:java}
> try:
> cls.hs2_client = cls.create_impala_client(protocol='hs2')
> except Exception, e:
> # HS2 connection can fail for benign reasons, e.g. running with unsupported
> auth.
> LOG.info("HS2 connection setup failed, continuing...: {0}", e) <--------
> {code}
> then it will fail with:
> {noformat}
> Traceback (most recent call last):
> File "/usr/lib64/python2.7/logging/__init__.py", line 851, in emit
> msg = self.format(record)
> File "/usr/lib64/python2.7/logging/__init__.py", line 724, in format
> return fmt.format(record)
> File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
> record.message = record.getMessage()
> File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage
> msg = msg % self.args
> TypeError: not all arguments converted during string formatting{noformat}
> The problem is that the statement uses "\{0}" replacements that work with
> .format() while LOG.info is using "%" replacements.
> We can fix this by using .format ourselves or changing the message to use "%"
> codes.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]