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

chore(vulnerable-code): Add more details to an issue message #8210

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

sschuberth
Copy link
Member

No description provided.

@sschuberth sschuberth requested a review from a team as a code owner February 1, 2024 16:50
@sschuberth sschuberth enabled auto-merge (rebase) February 1, 2024 16:50
issues += Issue(source = providerName, message = it.collectMessages())
issues += Issue(
source = providerName,
message = "Failed to request chunk ${index + 1} of ${chunks.size} (chunk size ${chunk.size}): " +
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for adding these details? e.g. for what purpose could the index and the size of the chunk be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

It helped me debug aboutcode-org/vulnerablecode#1411.

Copy link
Member

Choose a reason for hiding this comment

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

What do you think about alternatively doing all of these:

  1. leave the issue message as is (or at least do not add the chunk size)
  2. Create error / warning log message, which contains all purl values contained in the batch / chunk which failed.

Copy link
Member Author

Choose a reason for hiding this comment

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

or at least do not add the chunk size

What's the problem with adding the chunk size?

2. which contains all purl values contained in the batch / chunk which failed.

That would have been 91 PURLs in this case, blowing up the log message quite a bit.

In all, I still prefer the current solution.

Copy link
Member

@fviernau fviernau Feb 2, 2024

Choose a reason for hiding this comment

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

In general: I believe that for debugging it's ok to look into the log output and that not all information needed for debugging needs to go into issue message. It suffices if it points one to the relevant bits of the logs IMO.

What's the problem with adding the chunk size?

I believe that the chunk size is not sufficient information anyway, so it would not bring much value in debugging, as one needs to dig deeper anyway.

That would have been 91 PURLs in this case, blowing up the log message quite a bit.

Apart from that, my assumption was (maybe I was wrong here) that one of the purls must have cause the
issue. So, I assumed that figuring out the root cause would involve making individual requests for each purl in the chunk, to figure out the problematic one. This is why I proposed to log the PURL''s which to me translates to logging the request which failed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Apart from that, my assumption was (maybe I was wrong here) that one of the purls must have cause the
issue.

While that turned out to be correct, my initial assumption was that the timeout is related to a too big chunk size, which is why I was interested in it.

Also, OkHttpClientHelper already logs these kind of errors in general, so I wanted to add some additional information here to the issue.

Anyway, to move forward, I've changed to code to what you proposed.

@sschuberth sschuberth requested review from fviernau and a team February 2, 2024 11:48
@sschuberth sschuberth merged commit 4f8cb5e into main Feb 2, 2024
19 checks passed
@sschuberth sschuberth deleted the vc-issue-message branch February 2, 2024 15:55
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.

2 participants