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 queues debug logging to ignore aborted requests #1773

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

jbwcloudflare
Copy link
Contributor

WIP

  • Ignore "aborted" requests and only log info on timeouts
  • TODO: Add more contextual info (user account ID)

CC: @a-robinson

Copy link
Member

@a-robinson a-robinson left a comment

Choose a reason for hiding this comment

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

As mentioned in chat I believe we can get the script ID using incomingRequest->getContext().getWorker().getScript().getId(), but I'm not seeing an existing way to get the owner ID other than either plumbing it into the QueueEvent or returning the error back to the caller in some way for it to do the logging.

@@ -91,7 +91,8 @@ class IoContext_IncomingRequest {
// This method is also used by some custom event handlers (see WorkerInterface::CustomEvent) that
// need similar behavior, as well as the test handler. TODO(cleanup): Rename to something more
// generic?
kj::Promise<bool> finishScheduled();
enum class FinishScheduledResult { COMPLETED, ABORTED, TIMEOUT };
kj::Promise<FinishScheduledResult> finishScheduled();
Copy link
Member

Choose a reason for hiding this comment

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

Changing the return value here will also need a parallel change to the internal code since there are a couple callers of this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I've got that all wired up, just haven't put it up for PR yet.

@a-robinson
Copy link
Member

I'm not seeing an existing way to get the owner ID

To be clear, hopefully I've just missed something, but it doesn't look promising.

@a-robinson
Copy link
Member

Two force pushes:

  1. Rebase onto main
  2. Add scriptId to the log (tested locally to work as intended)

@a-robinson a-robinson marked this pull request as ready for review April 4, 2024 05:25
@a-robinson a-robinson requested review from a team as code owners April 4, 2024 05:25
@a-robinson a-robinson merged commit 8794354 into cloudflare:main Apr 4, 2024
10 checks passed
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