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

CLDR-17304 capture internalError check stack traces into the system log #3447

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Jan 10, 2024

CLDR-17304

  • before shipping off to front end, call system logger on any Subtype.internalError messages

  • confirmed that they show up in the liberty logfile. so, should be picked up by datadog

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

@srl295 srl295 self-assigned this Jan 10, 2024
btangmu
btangmu previously approved these changes Jan 10, 2024
Copy link
Member

@btangmu btangmu left a comment

Choose a reason for hiding this comment

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

LGTM except "tst" typo for "test" (I guess)

I wonder about thread safety when tests are run in parallel; it looks like reportTestInternalErrors is thread safe

macchiati
macchiati previously approved these changes Jan 10, 2024
@srl295
Copy link
Member Author

srl295 commented Jan 10, 2024

LGTM except "tst" typo for "test" (I guess)

I wonder about thread safety when tests are run in parallel; it looks like reportTestInternalErrors is thread safe

logging is thread safe

@srl295
Copy link
Member Author

srl295 commented Jan 10, 2024

Restructured so CheckCLDR does the logging directly, but also ConsoleCheck has that logging turned off (to not mess up output).

As a bonus, CheckCLDR subclasses could call logger.severe(…) etc to inject stuff into the logs.

{
  "type": "liberty_message",
  "host": "txamm-gt0cvd2.localdomain",
  "ibm_userDir": "/Users/srl295/src/cldr/tools/cldr-apps/target/liberty/wlp/usr/",
  "ibm_serverName": "cldr",
  "message": "Internal error: org.unicode.cldr.test.CheckForExemplars in ab",
  "ibm_threadId": "000000b6",
  "ibm_datetime": "2024-01-10T14:28:39.190-0600",
  "module": "CheckCLDR",
  "loglevel": "SEVERE",
  "ibm_methodName": "addError",
  "ibm_className": "org.unicode.cldr.test.CheckCLDR$CompoundCheckCLDR",
  "ibm_sequence": "1704918519190_000000000009C",
  "ibm_exceptionName": "java.util.ConcurrentModificationException",
  "ibm_stackTrace": "java.util.ConcurrentModificationException\n\tat java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095)\n\tat java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049)\n\tat org.unicode.cldr.test.CheckForExemplars.extractDatePatternText(CheckForExemplars.java:784)\n\tat org.unicode.cldr.test.CheckForExemplars.handleCheck(CheckForExemplars.java:345)\n\tat org.unicode.cldr.test.CheckCLDR$CompoundCheckCLDR.handleCheck(CheckCLDR.java:1381)\n\tat org.unicode.cldr.test.CheckCLDR.check(CheckCLDR.java:1272)\n\tat…"
}

- but add a facility so consolecheck does not see system logs
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPIHelper.java is no longer changed in the branch
  • tools/cldr-apps/src/main/java/org/unicode/cldr/web/DataPage.java is no longer changed in the branch
  • tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java is no longer changed in the branch
  • tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java is now changed in the branch
  • tools/cldr-code/src/main/java/org/unicode/cldr/test/ConsoleCheckCLDR.java is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@srl295 srl295 requested a review from macchiati January 10, 2024 20:46
@srl295
Copy link
Member Author

srl295 commented Jan 12, 2024

@btangmu @macchiati could I get a review of the rewritten PR? This now comprehensively logs all internalError checks as they happen. This will be helpful to look for issues.

@@ -344,6 +344,8 @@ static Level calculateCoverageLevel(final String coverageLevelInput, boolean for
* @throws Throwable
*/
public static void main(String[] args) throws Throwable {
// turn off logging to not mess up html and other output.
CheckCLDR.setLoggerLevel(java.util.logging.Level.OFF);
Copy link
Member

Choose a reason for hiding this comment

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

instead of disabling the log, how about capturing stderr and stdout separately as in java ... check ... 2> output.log 1> output.html?

Copy link
Member Author

Choose a reason for hiding this comment

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

@btangmu the errors are already handled as part of the checks in this case, though. This doesn't disable stderr.

Copy link
Member Author

Choose a reason for hiding this comment

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

this doesn't suppress any errors, it only suppresses printing out the logging in the ConsoleCheckCLDR tool environment.

@srl295 srl295 merged commit 2674fb3 into unicode-org:main Jan 16, 2024
10 checks passed
@srl295 srl295 deleted the cldr-17304/capture-stacktrace branch January 16, 2024 02:25
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