Skip to content

side output error feedback #925

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

Open
wants to merge 3 commits into
base: rc-v0.5.4
Choose a base branch
from
Open

Conversation

eschultink
Copy link
Member

@eschultink eschultink commented Jul 1, 2025

Features

  • return catchable exception if output write fail
  • catch that exception in webhook, side output use cases to give more meaningful feed back to client ( fatal error, non-fatal warning respectively)

Change implications

  • dependencies added/changed? no
  • something important to note in future release notes? no

@eschultink eschultink self-assigned this Jul 1, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes error handling for side outputs by introducing a checked WriteFailure exception, updating all Output implementations to throw it, and surfaces write failures in webhook and API data handlers; it also adds multi-valued header support to HTTP responses.

  • Define WriteFailure in Output and propagate it through all write methods
  • Update GCP/AWS handlers to catch WriteFailure and return meaningful HTTP warnings
  • Add multivaluedHeaders support in HTTP response builders

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
java/core/src/main/java/co/worklytics/psoxy/gateway/output/Output.java Added WriteFailure exception nested in Output interface
java/impl/gcp/src/main/java/co/worklytics/psoxy/GCSOutput.java Updated to throw WriteFailure on write errors
java/impl/aws/src/main/java/co/worklytics/psoxy/aws/SQSOutput.java Updated to throw WriteFailure on send errors
java/impl/aws/src/main/java/co/worklytics/psoxy/aws/S3Output.java Updated to throw WriteFailure on write errors
java/core/src/main/java/co/worklytics/psoxy/gateway/impl/output/CompressedOutputWrapper.java Wrapped exceptions in WriteFailure for compression failures
java/impl/aws/src/main/java/co/worklytics/psoxy/ResponseCompressionHandler.java Streams multi-valued headers into response builder
java/impl/gcp/src/main/java/co/worklytics/psoxy/HttpRequestHandler.java Appends multi-valued headers to HTTP response
java/impl/aws/src/main/java/co/worklytics/psoxy/Handler.java Populates multiValueHeaders in API Gateway v2 responses
java/impl/aws/src/main/java/co/worklytics/psoxy/APIGatewayV1Handler.java Populates multiValueHeaders in API Gateway v1 responses
java/core/src/main/java/co/worklytics/psoxy/gateway/impl/InboundWebhookHandler.java Catches WriteFailure and returns HTTP 500 on write failure
java/core/src/main/java/co/worklytics/psoxy/gateway/impl/BatchMergeHandler.java Catches WriteFailure when writing batched webhooks
java/core/src/main/java/co/worklytics/psoxy/gateway/impl/ApiDataRequestHandler.java Catches WriteFailure for original/sanitized side outputs
java/core/src/main/java/co/worklytics/psoxy/FunctionRuntimeModule.java Renamed provider methods to match new OutputUtils APIs
java/core/src/main/java/co/worklytics/psoxy/gateway/output/OutputToApiDataSideOutputAdapter.java Updated adapter to propagate WriteFailure instead of IOException
Comments suppressed due to low confidence (5)

java/core/src/main/java/co/worklytics/psoxy/FunctionRuntimeModule.java:116

  • The @Named qualifier forWebhooks no longer matches the renamed method outputUtils.forIncomingWebhooks(). Update the qualifier or method name for consistency in DI bindings.
    @Provides @Singleton  @Named("forWebhooks")

java/impl/gcp/src/main/java/co/worklytics/psoxy/GCSOutput.java:42

  • The WriteFailure exception is referenced but not imported or fully qualified. Add import co.worklytics.psoxy.gateway.output.Output.WriteFailure; or qualify it to prevent compile errors.
    public void write(String key, ProcessedContent content) throws WriteFailure {

java/impl/aws/src/main/java/co/worklytics/psoxy/aws/SQSOutput.java:40

  • The WriteFailure exception is thrown but not imported or fully qualified. Add import co.worklytics.psoxy.gateway.output.Output.WriteFailure; or use the fully qualified name.
    public void write(ProcessedContent content) throws WriteFailure {

java/impl/aws/src/main/java/co/worklytics/psoxy/aws/S3Output.java:49

  • The WriteFailure exception is thrown but not imported. Add import co.worklytics.psoxy.gateway.output.Output.WriteFailure; or fully qualify the exception class.
    public void write(String key, ProcessedContent content) throws WriteFailure {

java/core/src/main/java/co/worklytics/psoxy/gateway/impl/output/CompressedOutputWrapper.java:25

  • The WriteFailure exception is thrown but not imported. Include import co.worklytics.psoxy.gateway.output.Output.WriteFailure; or use the fully qualified name.
    public void write(ProcessedContent content) throws WriteFailure {

@eschultink eschultink changed the title S202 : side output error feedback side output error feedback Jul 1, 2025
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.

1 participant