Skip to content

Expose async writes to HTTP Stream Manager#987

Merged
azkrishpy merged 7 commits into
mainfrom
write-stream
May 13, 2026
Merged

Expose async writes to HTTP Stream Manager#987
azkrishpy merged 7 commits into
mainfrom
write-stream

Conversation

@azkrishpy
Copy link
Copy Markdown
Contributor

@azkrishpy azkrishpy commented May 12, 2026

Issue #, if available:

Description of changes:

  • Bind out the write data API #981 exposes write data to connections but stream manager's acquire API automatically calls connections with no boolean for useManualDataWrites. This change adds an overloaded implementation of acquire stream to add the manual writes as a boolean.
  • This also changes native write data to avoid a copy by setting up a new global reference to user's byte array that will get cleaned up after callback is invoked or if the API errors out.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@azkrishpy azkrishpy marked this pull request as ready for review May 12, 2026 20:34

data_cur = aws_byte_cursor_from_buf(&callback_data->data_buf);
callback_data->data_stream = aws_input_stream_new_from_cursor(aws_jni_get_allocator(), &data_cur);
/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's add a test for this, if we don't already have one.
invoke the write data API with a local variable (Or somehow remove the reference to the object from java side). We should sill keep the data alive and works as expected since we keep the object referenced in C here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

modified the existing happy path tests to create weak references and remove object, forced a gc and checked for the the weak reference to not be null.

@azkrishpy azkrishpy merged commit 437d863 into main May 13, 2026
57 of 58 checks passed
@azkrishpy azkrishpy deleted the write-stream branch May 13, 2026 21:07
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