Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: aggregate errors that happen too often during infra loading #10345

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

eckter
Copy link
Contributor

@eckter eckter commented Jan 13, 2025

Fix #8773

After:

[15:46:49,574] [INFO]          [ValidateInfra] parsing json
[15:46:52,963] [INFO]          [ValidateInfra] parsing RailJSON
[15:46:57,358] [WARN]      [RawInfraRJSParser] Electrification conflict on track-range TRACK_ID[53m, 1168m]: 25000V != 3000V
[15:46:57,358] [WARN]      [RawInfraRJSParser] Electrification conflict on track-range TRACK_ID[23m, 487m]: 25000V != 3000V
[15:46:57,358] [WARN]      [RawInfraRJSParser] Electrification conflict on track-range TRACK_ID[487m, 974m]: 25000V != 3000V
[15:46:57,371] [WARN]      [RawInfraRJSParser] ... and 90 other similar errors
[15:47:10,282] [INFO]          [ValidateInfra] loading signals
[15:47:10,502] [INFO]          [ValidateInfra] building blocks
[15:47:12,318] [DEBUG]          [BlockBuilder] no signal at non buffer stop detector.DETECTOR_ID:DECREASING
[15:47:12,318] [DEBUG]          [BlockBuilder] no signal at non buffer stop detector.DETECTOR_ID:INCREASING
[15:47:12,318] [DEBUG]          [BlockBuilder] no signal at non buffer stop detector.DETECTOR_ID:INCREASING
[15:47:12,328] [DEBUG]          [BlockBuilder] ... and 1256 other similar errors
[15:47:12,536] [DEBUG] [SignalingSimulatorImpl] error in block BLOCK_ID: too_few_signals
[15:47:12,536] [DEBUG] [SignalingSimulatorImpl] error in block BLOCK_ID: too_few_signals
[15:47:12,536] [DEBUG] [SignalingSimulatorImpl] error in block BLOCK_ID: too_few_signals
[15:47:12,537] [DEBUG] [SignalingSimulatorImpl] ... and 955 other similar errors
[15:47:12,537] [INFO]          [ValidateInfra] done

Before: same thing but over 2k2 lines

@eckter eckter requested a review from a team as a code owner January 13, 2025 14:49
@eckter eckter requested a review from Khoyo January 13, 2025 14:49
@github-actions github-actions bot added the area:core Work on Core Service label Jan 13, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.63%. Comparing base (675d279) to head (666849a).
Report is 1 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10345      +/-   ##
==========================================
- Coverage   81.64%   81.63%   -0.01%     
==========================================
  Files        1066     1066              
  Lines      105735   105735              
  Branches      727      727              
==========================================
- Hits        86328    86321       -7     
- Misses      19366    19373       +7     
  Partials       41       41              
Flag Coverage Δ
editoast 73.65% <ø> (-0.03%) ⬇️
front 89.33% <ø> (ø)
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eckter eckter force-pushed the ech/aggregate-logs branch 2 times, most recently from 8134a05 to 3e2fbb6 Compare January 14, 2025 08:29
@eckter eckter requested a review from Erashin January 14, 2025 08:59
Copy link
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

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

The solution is quite elegant.

But how about just raising the log level when deployed (or even default to info)?
Then we can also consider lowering log-level for electrification (and move this to a more important tracking on the data-production side).
If we are able to target specific log-levels on specific areas of the code (like warning for infra import and debug for the rest), it may also avoid revision of all log-levels of the component.

@eckter eckter force-pushed the ech/aggregate-logs branch from 30f997a to 103acf2 Compare January 15, 2025 08:13
Copy link
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

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

It's OK to merge IMO.
The previous comment about adjusting log-level is still "alive" IMO, but any pick is OK.

@eckter
Copy link
Contributor Author

eckter commented Jan 15, 2025

But how about just raising the log level when deployed (or even default to info)?
Then we can also consider lowering log-level for electrification (and move this to a more important tracking on the data-production side).
If we are able to target specific log-levels on specific areas of the code (like warning for infra import and debug for the rest), it may also avoid revision of all log-levels of the component.

We should probably look into this at some point (refining the log levels and what we want in prod).

But I don't think it would be enough, some errors are important enough to be logged in prod environments, without necessarily having all the details.

Like I've just added an aggregation for this error that happens in prod but (usually) not in local, it's quite important to know that it's there but there's no need to log it dozens of times per request.

Copy link
Contributor

@Erashin Erashin left a comment

Choose a reason for hiding this comment

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

Works for me, GJ!

@eckter eckter force-pushed the ech/aggregate-logs branch from ba916ae to 666849a Compare January 15, 2025 13:29
@eckter eckter enabled auto-merge January 15, 2025 13:29
@eckter eckter added this pull request to the merge queue Jan 15, 2025
Merged via the queue into dev with commit a450ed4 Jan 15, 2025
27 checks passed
@eckter eckter deleted the ech/aggregate-logs branch January 15, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core Work on Core Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

core: be more selective about what we log
4 participants