You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by bo...@apache.org on 2023/03/23 10:01:43 UTC
[kyuubi] branch branch-1.7 updated: [KYUUBI #4563] [Improvement] Format error log output in case of metrics json file not found
This is an automated email from the ASF dual-hosted git repository.
bowenliang pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.7 by this push:
new 0fbb61867 [KYUUBI #4563] [Improvement] Format error log output in case of metrics json file not found
0fbb61867 is described below
commit 0fbb618678aaf334283122ecd97baa5fac1c39de
Author: zwangsheng <22...@qq.com>
AuthorDate: Thu Mar 23 18:01:16 2023 +0800
[KYUUBI #4563] [Improvement] Format error log output in case of metrics json file not found
### _Why are the changes needed?_
Before
```log
2023-03-20 10:02:04.718 ERROR org.apache.kyuubi.metrics.JsonReporterService: Error writing metrics to json file/pathi/metrics/report.json
```
After
```log
2023-03-20 10:02:04.718 ERROR org.apache.kyuubi.metrics.JsonReporterService: Error writing metrics to json file: /path/metrics/report.json
```
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #4563 from zwangsheng/fix/format_json_file_not_found_error.
Closes #4563
7b37616a3 [Binjie Yang] Update kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/JsonReporterService.scala
daace3598 [zwangsheng] [Improvement] Format error log output in case of metrics json file not found
Lead-authored-by: zwangsheng <22...@qq.com>
Co-authored-by: Binjie Yang <52...@users.noreply.github.com>
Signed-off-by: liangbowen <li...@gf.com.cn>
(cherry picked from commit cb962304e538e660aabef2fe6bc2f224746d0ed8)
Signed-off-by: liangbowen <li...@gf.com.cn>
---
.../src/main/scala/org/apache/kyuubi/metrics/JsonReporterService.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/JsonReporterService.scala b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/JsonReporterService.scala
index cb0ef7404..7b172fc1e 100644
--- a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/JsonReporterService.scala
+++ b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/JsonReporterService.scala
@@ -65,7 +65,7 @@ class JsonReporterService(registry: MetricRegistry)
Files.setPosixFilePermissions(tmpPath, PosixFilePermissions.fromString("rwxr--r--"))
Files.move(tmpPath, reportPath, StandardCopyOption.REPLACE_EXISTING)
} catch {
- case NonFatal(e) => error("Error writing metrics to json file" + reportPath, e)
+ case NonFatal(e) => error(s"Error writing metrics to json file: $reportPath", e)
} finally {
if (writer != null) writer.close()
}