You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Wilfred Spiegelenburg (Jira)" <ji...@apache.org> on 2020/04/02 03:53:00 UTC

[jira] [Resolved] (YUNIKORN-64) Add zap encoders for time and duration

     [ https://issues.apache.org/jira/browse/YUNIKORN-64?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wilfred Spiegelenburg resolved YUNIKORN-64.
-------------------------------------------
    Fix Version/s: 0.8
         Assignee: Wilfred Spiegelenburg
       Resolution: Fixed

shim and core code have both been fixed

unit test code has comments on side effects of test functions and how to resolve them

> Add zap encoders for time and duration
> --------------------------------------
>
>                 Key: YUNIKORN-64
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-64
>             Project: Apache YuniKorn
>          Issue Type: Task
>          Components: core - common
>            Reporter: Wilfred Spiegelenburg
>            Assignee: Wilfred Spiegelenburg
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.8
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In YUNIKORN-62 a nil pointer caused a panic. The fix was to change the log call from a Duration to a String.
> The real issue is the fact that the encoders for certain types are not set in the logger. This is most likely an OS or internationalisation configuration related issue. In the code we fail here:
> {code}
> panic: runtime error: invalid memory address or nil pointer dereference[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11ac568] goroutine 51 [running]:go.uber.org/zap/zapcore.(*jsonEncoder).AppendDuration(0xc007eca390, 0x77370eba) /Users/wyang/go/pkg/mod/go.uber.org/zap@v1.13.0/zapcore/json_encoder.go:239 
> {code}
> That links to the source code here:
> {code}
> 237  func (enc *jsonEncoder) AppendDuration(val time.Duration) {
> 238  	cur := enc.buf.Len()
> 239  	enc.EncodeDuration(val, enc)
> {code}
> That can only happen if the {{EncodeDuration}} function is nil.
> This links back to a similar [zap issue #645|https://github.com/uber-go/zap/issues/645] for time stamps. In the comments it says that the encoders are not optional for certain parts. We should make sure that the encoders are set correctly as that looks like it is the correct solution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org