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

403 fix #44

Merged
merged 14 commits into from
Oct 6, 2024
Merged

403 fix #44

merged 14 commits into from
Oct 6, 2024

Conversation

rw2
Copy link
Collaborator

@rw2 rw2 commented Sep 19, 2024

Repairs a 403 error listing files from S3. Also adds some debug code that proved very useful in finding the bug. The debug code is currently commented out.

Copy link
Collaborator

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

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

Some cleanup of the approach is needed, though the fix looks correct.

Before pushing revisions, please tidy up the branch following the OSG advice on git branch maintenance:

https://osg-htc.org/technology/software/git-software-development/#making-good-pull-requests-the-art-of-good-commits

Particularly, please pay attention to commit messages and tidying up in-progress work.


AmazonRequest(const std::string &s, const std::string &akf,
const std::string &skf, const std::string &b,
const std::string &o, const std::string &style, int sv,
XrdSysError &log)
XrdSysError &log, bool ro = true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This constructor change doesn't appear to be used. Let's scrap it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This constructor is used by the courtesy constructor that has a simpler interface, does some translations and then calls this one. This is actually where the bookkeeping is done for the retention policy.

@@ -260,7 +263,9 @@ class AmazonS3List : public AmazonRequest {
public:
AmazonS3List(const S3AccessInfo &ai, const std::string &objectName,
size_t maxKeys, XrdSysError &log)
: AmazonRequest(ai, objectName, log), m_maxKeys(maxKeys) {}
: AmazonRequest(ai, objectName, log, false), m_maxKeys(maxKeys) {
retain_object = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sets retainObject in two different ways. Pick one.

If you keep the protected variable, do something like this instead:

		: AmazonRequest(ai, objectName, log, false), m_maxKeys(maxKeys), retainObject(false) {

@@ -380,6 +427,8 @@ bool HTTPRequest::sendPreparedRequest(const std::string &protocol,
}
return false;
}
// rv = curl_easy_setopt(curl.get(), CURLOPT_DEBUGFUNCTION, debug_callback);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understand the second bullet and can make that happen. Also, yes, it almost has to be a new level because this will result in crazy large logfiles and probably a bit of latency.

I don't think I get the first bullet though. We are using a libcurl call here to register the debug callback. How would we pass a logging object into that library and have it be available when the callbacks are made?

rw2 and others added 3 commits September 24, 2024 13:00
Copy link
Collaborator

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

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

LGTM.

@bbockelm bbockelm merged commit 6995fcd into PelicanPlatform:main Oct 6, 2024
6 checks passed
@rw2 rw2 deleted the 403-fix branch January 6, 2025 23:57
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