beacon-biosignals / K8sClusterManagers.jl

A Julia cluster manager for Kubernetes
Other
31 stars 5 forks source link

Address reporting duplicate error messages #18

Closed omus closed 3 years ago

omus commented 3 years ago

Addresses part of this comment: https://github.com/beacon-biosignals/K8sClusterManagers.jl/issues/12#issuecomment-804397605

Fix the double stack trace. I'm not sure why the stack trace was emitted twice here but it's also just adding noise

Here's a quick example when running the cluster manager on my local system. I've removed the stacktraces to make the output shorter.

Without this PR:

julia> ENV["HOSTNAME"] = "localhost";

julia> K8sClusterManagers.addprocs_pod(1)
[ Info: unsupported events.k8s.io/v1
[ Info: unsupported certificates.k8s.io/v1
[ Info: unsupported node.k8s.io/v1
[ Info: unsupported flowcontrol.apiserver.k8s.io/v1beta1
ERROR: Swagger.ApiException(404, "Not Found", HTTP.Messages.Response:
"""
HTTP/1.1 404 Not Found
Cache-Control: no-cache, private
Content-Length: 186
Content-Type: application/json
Date: Fri, 09 Apr 2021 17:55:56 GMT
X-Kubernetes-Pf-Flowschema-Uid: 198121e7-8b62-4f63-a220-9ebe10e3e597
X-Kubernetes-Pf-Prioritylevel-Uid: 03120ce8-c0ee-46e3-8213-e7f5473f6db0
Connection: close

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"localhost\" not found","reason":"NotFound","details":{"name":"localhost","kind":"pods"},"code":404}
""")
Stacktrace: ...

caused by: UndefVarError: readPod not defined
Stacktrace: ...

caused by: Swagger.ApiException(404, "Not Found", HTTP.Messages.Response:
"""
HTTP/1.1 404 Not Found
Cache-Control: no-cache, private
Content-Length: 186
Content-Type: application/json
Date: Fri, 09 Apr 2021 17:55:56 GMT
X-Kubernetes-Pf-Flowschema-Uid: 198121e7-8b62-4f63-a220-9ebe10e3e597
X-Kubernetes-Pf-Prioritylevel-Uid: 03120ce8-c0ee-46e3-8213-e7f5473f6db0
Connection: close

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"localhost\" not found","reason":"NotFound","details":{"name":"localhost","kind":"pods"},"code":404}
""")
Stacktrace: ...

caused by: UndefVarError: readPod not defined
Stacktrace: ...

With this PR:

julia> ENV["HOSTNAME"] = "localhost";

julia> K8sClusterManagers.addprocs_pod(1)
[ Info: unsupported events.k8s.io/v1
[ Info: unsupported certificates.k8s.io/v1
[ Info: unsupported node.k8s.io/v1
[ Info: unsupported flowcontrol.apiserver.k8s.io/v1beta1
ERROR: Swagger.ApiException(404, "Not Found", HTTP.Messages.Response:
"""
HTTP/1.1 404 Not Found
Cache-Control: no-cache, private
Content-Length: 186
Content-Type: application/json
Date: Fri, 09 Apr 2021 17:56:57 GMT
X-Kubernetes-Pf-Flowschema-Uid: 198121e7-8b62-4f63-a220-9ebe10e3e597
X-Kubernetes-Pf-Prioritylevel-Uid: 03120ce8-c0ee-46e3-8213-e7f5473f6db0
Connection: close

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"localhost\" not found","reason":"NotFound","details":{"name":"localhost","kind":"pods"},"code":404}
""")
Stacktrace: ...

caused by: UndefVarError: readPod not defined
Stacktrace: ...
omus commented 3 years ago

I've now worked around the issue causing:

Fix UndefVarError: readPod not defined. This error makes it appear that there is an internal failure happening