Eventing: DeliverySpec.backoffDelay does not accept RFC3339 duration, but timestamp

Created on 9 Jul 2020  路  11Comments  路  Source: knative/eventing

kinbug kingood-first-issue prioritimportant-soon

All 11 comments

time.ParseDuration() uses a custom format, not RFC3339 and time.Parse(...) parses timestamps. You might need https://github.com/peterhellberg/duration/blob/master/duration.go or similar

@lionelvillard What was the intent for valid values for this field?

The intent is to use the ISO8601 duration format which is not covered by RFC3339 (only mentioned in the Appendix A).

We need to fix our doc and implementation.

Thanks @FWiesner for reporting this!

btw what is the default value?

AFAIK, there is no channel implementations supporting retries and there is no predefined default values.

@lionelvillard I've heard repeatedly the KafkaChannel would

Seems like in golang stdlib there is no way to define the format to parse a duration... https://github.com/knative/eventing/issues/3555

/assign

There is this library https://github.com/senseyeio/duration/blob/master/duration.go which implements this library but then uses its own Duration type more than the one in the stdlib. We might take inspiration for the parsing part, but then use the golang stdlib type... wdyt @pierDipi ?

This lib seems maintained https://github.com/rickb777/date (latest release 4 days ago), and also, it supports converting the parsed duration to the standard time.Duration.

cool, then sgtm!

Was this page helpful?
0 / 5 - 0 ratings