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

fix: Fix NPE and logging #1521

Merged
merged 1 commit into from
Jan 21, 2021
Merged

fix: Fix NPE and logging #1521

merged 1 commit into from
Jan 21, 2021

Conversation

pawelpasterz
Copy link
Contributor

@pawelpasterz pawelpasterz commented Jan 20, 2021

Fixes #

What was done?

  • Fix NPE that was causing initialization error and flank crash as a result
    Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class flank.common.config.FlankPropertiesKt
    at ftl.util.CrashReporterKt.report(CrashReporter.kt:31)
    at ftl.run.exception.ExceptionHandlerKt.withGlobalExceptionHandling(ExceptionHandler.kt:78)
    at ftl.run.exception.ExceptionHandlerKt.withGlobalExceptionHandling(ExceptionHandler.kt:12)
    at ftl.Main$Companion.main(Main.kt:54)
    at ftl.Main.main(Main.kt)
    
  • GoogleApiLogger (all actually) was incorrectly enabled during Sentry client initialization. As result, output was flooded with logs if at least one FTL IOException was thrown
    Jan 20, 2021 8:40:28 PM com.google.api.client.http.HttpRequest execute
    CONFIG: -------------- REQUEST  --------------
    POST https://oauth2.googleapis.com/token
    Accept-Encoding: gzip
    User-Agent: Google-HTTP-Java-Client/1.38.1 (gzip)
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    Content-Length: 234
    
    Jan 20, 2021 8:40:28 PM com.google.api.client.http.HttpRequest execute
    CONFIG: curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'User-Agent: Google-HTTP-Java-Client/1.38.1 
    (gzip)' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -d '@-' -- 
    'https://oauth2.googleapis.com/token' << $$$
    Jan 20, 2021 8:40:28 PM com.google.api.client.util.LoggingByteArrayOutputStream close
    CONFIG: Total: 234 bytes
    Jan 20, 2021 8:40:28 PM com.google.api.client.util.LoggingByteArrayOutputStream close
    CONFIG: 
    (and lots of more)
    

Test Plan

How do we know the code works?

  1. Run ./gradlew clean flankFullRun
  2. There should be no errors
  3. Start flank run but from outside the project directory (use flank fat jar)
  4. Run should proceed normally

@pawelpasterz pawelpasterz self-assigned this Jan 20, 2021
@github-actions
Copy link
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@github-actions
Copy link
Contributor

Timestamp: 2021-01-20 20:23:11
Buildscan url for ubuntu-workflow run 499476055
https://gradle.com/s/7fhjdzj357ch6

@pawelpasterz pawelpasterz marked this pull request as ready for review January 20, 2021 20:27
Copy link
Contributor

@adamfilipow92 adamfilipow92 left a comment

Choose a reason for hiding this comment

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

👍

@piotradamczyk5 piotradamczyk5 self-requested a review January 21, 2021 06:13
@mergify mergify bot merged commit d96f841 into master Jan 21, 2021
@mergify mergify bot deleted the fix-npe-and-incorrect-logging branch January 21, 2021 06:13
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants