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 error responses for local cache #1041

Merged
merged 7 commits into from
Apr 5, 2024

Conversation

bbockelm
Copy link
Collaborator

@bbockelm bbockelm commented Apr 3, 2024

This PR does two primary things:

  1. Allows the local cache to respond with a 404 when upstream does.
  2. Allows the local cache to timeout before the plugin does, giving the client a 504 (Gateway timeout).

Along the way, two improvements:

  1. The TransferJob object now takes a context and can be canceled.
  2. You can retrieve the PID of the running xrootd process(es). This is used to be able to SIGSTOP the xrootd daemon to make it unresponsive in unit tests.

If the local cache returns an error status (e.g., 403, 404),
make sure that error propagates as part of the HTTP error code, not
as an error after the transfer has started.
To add a unit test for timeouts, first add the capability to return
the pids associated with a server.  This allows the unit test to
SIGSTOP the server (and then the unit test can just wait for the
timeout).
Change the local cache so it will take a timeout value from the
headers and create a corresponding context deadline.  In that case,
ensure the local cache returns a 504 so the client knows that the cache
isn't being unresponsive (but rather something upstream is).
@bbockelm bbockelm added enhancement New feature or request client Issue affecting the OSDF client cache Issue relating to the cache component labels Apr 3, 2024
@bbockelm bbockelm requested a review from joereuss12 April 3, 2024 19:56
Copy link
Contributor

@joereuss12 joereuss12 left a comment

Choose a reason for hiding this comment

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

Any conflicts should be resolved now and everything looks good to me!

@joereuss12 joereuss12 merged commit 3dffcab into PelicanPlatform:main Apr 5, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache Issue relating to the cache component client Issue affecting the OSDF client enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants