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

update interceptor logging for PCU #1097

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

singhravidutt
Copy link
Contributor

@singhravidutt singhravidutt commented Jan 3, 2024

Fixed below 2 issues:

  1. PCU had issue in logging null uploadIds.

    • PCUs use direct upload for part files and hence don't have concept of uploadIds. Updated code to have a default uploadId as empty string instead of null value.
  2. In Direct uploads incocationIds were gettign logged as NOT-FOUND.

    • Earlier we were dependent on streamCreated to update the Ids for tracing but there are cases when actual stream creation is delayed and sometimes even happened after onMessage is called . Updated the logic of updatign invocationid in tracers by updating it as soon as we get the request to start the tracer i.e. SimpleForwardingClientCall.start.

Added integration test to very the tracing for PCU calls.

@singhravidutt
Copy link
Contributor Author

/gcbrun

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (c208df4) 70.75% compared to head (20dfcef) 81.55%.
Report is 2 commits behind head on master.

Files Patch % Lines
...google/cloud/hadoop/gcsio/testing/MockStorage.java 76.00% 5 Missing and 1 partial ⚠️
...oogleCloudStorageClientGrpcTracingInterceptor.java 92.30% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #1097       +/-   ##
=============================================
+ Coverage     70.75%   81.55%   +10.79%     
- Complexity     1571     1790      +219     
=============================================
  Files           100      102        +2     
  Lines          7859     7916       +57     
  Branches        967      974        +7     
=============================================
+ Hits           5561     6456      +895     
+ Misses         1886     1057      -829     
+ Partials        412      403        -9     
Flag Coverage Δ
integrationtest 67.76% <45.12%> (?)
unittest 70.99% <43.90%> (+0.23%) ⬆️

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.

@singhravidutt singhravidutt marked this pull request as ready for review January 5, 2024 05:19
Copy link
Contributor

@arunkumarchacko arunkumarchacko left a comment

Choose a reason for hiding this comment

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

The code is way too complex. Can you please add any background information relevant to this so that readers can figure out WHY/HOW this is working.

private void updateUploadId(@Nonnull String uploadId) {
if (streamUploadId == null) {
private void updateStreamUploadId(@Nonnull String uploadId) {
if (Strings.isNullOrEmpty(streamUploadId) && !Strings.isNullOrEmpty(uploadId)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess streamUploadId and uploadId cannot be null?


logRecords
.put(GoogleCloudStorageTracingFields.WRITE_OFFSET.name, request.getWriteOffset())
.put(GoogleCloudStorageTracingFields.FINALIZE_WRITE.name, request.getFinishWrite())
Copy link
Contributor

Choose a reason for hiding this comment

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

FInish write is same as finalizewrite?

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.

None yet

2 participants