-
Notifications
You must be signed in to change notification settings - Fork 1
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
[PROF-10028] Avoid re-uploading already successfully uploaded file #24
Conversation
3d86a02
to
04afab1
Compare
return &DatadogUploader{ | ||
ddAPIKey: ddAPIKey, | ||
intakeURL: intakeURL, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: why the extra lines (mostly curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly cosmetic to separate fields that are based on user input, from internal fields that are initialized by the structure itself
const sourceMapEndpoint = "/api/v2/srcmap" | ||
|
||
type DatadogUploader struct { | ||
ddAPIKey string | ||
intakeURL string | ||
|
||
uploadCache *lru.SyncedLRU[libpf.FileID, struct{}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the choice of file ID seems good
If we want to consider split debug, we would probably not cache the id of the split file, only of the main binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 👍 That's how it's implemented in #25 AFAICT 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for analyzing the scenario that lead to this!
The base branch was changed.
04afab1
to
1e4ada9
Compare
While looking at a local run of #23 I noticed the following logs (truncated), which come from uploading the local symbols for /usr/bin/docker multiple times.
This happens because the process manager only keeps track of executables as long as they are mapped for an existing process. In the case above, a process is running the
docker
CLI, so the process manager sees the executable a first time. Then thedocker
CLI commands exists, the process manager forgets about that executable (throughRemoveOrDecRef()
). The next time adocker
CLI process is launched, the process manager will consider it as a new executable, and hence we try to re-upload symbols for that binary.In the short-term, we can work around this by adding a cache on already uploaded files and avoid re-uploads if they were previously already uploaded successfully.