Project

General

Profile

Actions

Bug #43897

open

crash module reports UTC timestamps but doesn't format timestamps accordingly

Added by Jan Fajerski about 4 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
low-hanging-fruit
Backport:
pacific, octopus, nautilus
Regression:
No
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

This can be confusing:

~ # ceph health detail
HEALTH_WARN 1 daemons have recently crashed
RECENT_CRASH 1 daemons have recently crashed
    mon.c1boyd1 crashed on host c1boyd1 at 2020-01-28 01:35:32.305835Z
~ # date
Mon Jan 27 19:05:47 MST 2020

The "Z" suffix on the datestring implies UTC iiuc but a +00 or so would probably be better.

Actions #1

Updated by Nathan Cutler about 4 years ago

  • Tags set to low-hanging-fruit
Actions #2

Updated by Nathan Cutler about 4 years ago

  • Assignee set to Nathan Cutler

I guess "2020-01-28 01:35:32.305835Z" is a variant of

$ date --utc --rfc-3339=seconds
2020-04-02 11:13:42+00:00

and the latter one does indeed look more user-friendly.

Actions #3

Updated by Nathan Cutler over 3 years ago

So, since the timestamp is guaranteed to be UTC, the solution would be to use the "time_from_string" method to convert it into a Python datetime object, and then re-create the string like so:

>>> print('{}+00:00'.format(datetime.datetime.utcnow().isoformat(' ', timespec='seconds')))
2020-08-16 01:33:27+00:00

NOTE: in this example we are just generating an arbitrary datetime object using "datetime.datetime.utcnow()". The point is to show how to generate the timestamp string in the desired format.

Actions #4

Updated by Nathan Cutler over 3 years ago

  • Backport set to octopus, nautilus
Actions #5

Updated by Nathan Cutler over 3 years ago

  • Status changed from New to In Progress
Actions #6

Updated by Nathan Cutler over 3 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 36671
Actions #7

Updated by Nathan Cutler about 3 years ago

  • Status changed from Fix Under Review to New
  • Assignee deleted (Nathan Cutler)
  • Pull request ID deleted (36671)

see https://github.com/ceph/ceph/pull/36671 for one attempt to fix this "low-hanging fruit"

(Maybe "cosmetic issue with heavy test exposure" would be a better description than "low-hanging fruit" in this case?)

Actions #8

Updated by Nathan Cutler about 3 years ago

  • Backport changed from octopus, nautilus to pacific, octopus, nautilus
Actions #9

Updated by Ernesto Puerta about 3 years ago

  • Translation missing: en.field_tag_list set to low-hanging-fruit
Actions

Also available in: Atom PDF