[ 
https://issues.apache.org/jira/browse/YUNIKORN-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17071114#comment-17071114
 ] 

Weiwei Yang commented on YUNIKORN-64:
-------------------------------------

Hi [~wilfreds], thanks for finding out the root cause of the issue. I agree we 
need to fix this issue and get back to use time.Duration for better logging.

> 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
>            Priority: Major
>
> 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-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to