-
Notifications
You must be signed in to change notification settings - Fork 2
fix: handle CRT native connection resources more carefully #198
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
} | ||
} | ||
|
||
private fun dereferenceUserdata(userdata: COpaquePointer?): StableRef<HttpStreamContext>? = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment explaining why we need this? Similar to your explanation in the PR description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
KonanTarget.WATCHOS_ARM64 -> "arm64_32" | ||
else -> null | ||
} | ||
else -> null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiler was complaining that the check was unnecessary because the when
branches are already exhaustive.
This comment has been minimized.
This comment has been minimized.
6e9b209
to
40462ad
Compare
Affected ArtifactsChanged in size
|
Issue #, if available:
(none)
Description of changes:
While attempting to re-enable some ignored smithy-kotlin tests discovered a
NullPointerException
being thrown when canceling a stream as part of a test. The root cause is thatStableRef<T>.get()
can throw NPE when the opaque pointer has been modified by CRT. Thus, this change rewrites the resource handling in HttpClientConnectionNative.kt to anticipate NPEs and handle them as gracefully as possible.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.