Skip to content

Conversation

@junghao
Copy link
Contributor

@junghao junghao commented Oct 20, 2025

Previously we deployed in prod
#269
#270
#272
and caused services like shaking layer getting errors, so we rolled back in an hour.

After more detailed clarification https://github.com/orgs/GeoNet/projects/37/views/27?pane=issue&itemId=133985258&issue=GeoNet%7Ctickets%7C18946, the conclusion be:
Only StationXML 1.2 adopts RFC3339 time format. and all other endpoints/responses still using old FDSN format time (similar to RFC3339, but without timezone info).

In this PR, I split the timestamp into two implementations, one for general FDSN use, one specifically for StationXML use.

Deployed in http://tf-dev-fdsn-web-1308277073.ap-southeast-2.elb.amazonaws.com.

====

Last failed deployment resulted in ShakingLayer-api having errors like

/api/v1/events apiHandler parsing time "2025-09-16T11:01:42.63043Z": extra text: "Z"

I ran shaking layer api locally by pointing FDSN to the updated dev instance and it works without errors.

@junghao junghao force-pushed the timezone-rollback branch 4 times, most recently from 04a489e to a2a7de6 Compare October 20, 2025 21:30
@junghao junghao requested a review from wilsonjord October 20, 2025 21:53
@junghao junghao force-pushed the timezone-rollback branch 2 times, most recently from 8ddc8ab to d2b2f18 Compare October 22, 2025 04:56
Comment on lines 575 to 571
s := fmt.Sprintf("%s|%s|%.3f|%.3f|%.1f|GNS|GNS|GNS|%s|%s|%.1f|GNS|%s|%s\n", eventID, tm.UTC().Format(time.RFC3339Nano), latitude, longitude, depth, eventID, magType, magnitude, loc, eventType)
s := fmt.Sprintf("%s|%s|%.3f|%.3f|%.1f|GNS|GNS|GNS|%s|%s|%.1f|GNS|%s|%s\n", eventID, tm.Format(fdsn.WsMarshalTimeFormat), latitude, longitude, depth, eventID, magType, magnitude, loc, eventType)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is tm in this scenario already UTC? If tm is localtime, would you get difference results?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it's unlikely but since we called UTC() previously, we should keep doing it.

Comment on lines 801 to 802
if v.StartTime != fdsn.ZeroWsDateTime {
st := v.StartTime.Time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(non-blocking): if you like oneliners: if st := v.StartTime.Time; v.StartTime != fdsn.ZeroWsDateTime {

Comment on lines 819 to 820
if v.EndTime != fdsn.EmptyWsDateTime {
et := v.EndTime.Time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: can be one line, see above

@junghao junghao requested a review from wilsonjord October 27, 2025 20:35
Copy link

@wilsonjord wilsonjord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@sue-h-gns sue-h-gns merged commit 4777d82 into main Oct 27, 2025
12 checks passed
@sue-h-gns sue-h-gns deleted the timezone-rollback branch October 27, 2025 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants