-
Notifications
You must be signed in to change notification settings - Fork 10
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
Switch from reqwest to hyper and add uds support #2
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Take the form multipart implementation from reqwest and adapt it to use with hyper
PR has been merged in libddprof first |
bwoebi
added a commit
that referenced
this pull request
May 24, 2024
It apparently leads to race conditions if libpthread and libc aren't loaded at the same time. In this case a library linking against libpthread is dlopen()'ed dynamically from the trampoline. It led to interesting libc memory corruptions, like in getaddrinfo: #2 0x00007fe45328df67 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7fe4533a05d0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:196 #3 0x00007fe453296329 in malloc_printerr (ar_ptr=0x7fe4535dc760 <main_arena>, ptr=<optimized out>, str=0x7fe4533a06d8 "double free or corruption (out)", action=3) at malloc.c:4967 #4 _int_free (av=0x7fe4535dc760 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3843 #5 0x00007fe453283247 in _IO_new_fclose (fp=0x7fe448001d20) at iofclose.c:84 etc. on older glibc versions. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
bwoebi
added a commit
that referenced
this pull request
May 24, 2024
It apparently leads to race conditions if libpthread and libc aren't loaded at the same time. In this case a library linking against libpthread is dlopen()'ed dynamically from the trampoline. It led to interesting libc memory corruptions, like in getaddrinfo: #2 0x00007fe45328df67 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7fe4533a05d0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:196 #3 0x00007fe453296329 in malloc_printerr (ar_ptr=0x7fe4535dc760 <main_arena>, ptr=<optimized out>, str=0x7fe4533a06d8 "double free or corruption (out)", action=3) at malloc.c:4967 #4 _int_free (av=0x7fe4535dc760 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3843 #5 0x00007fe453283247 in _IO_new_fclose (fp=0x7fe448001d20) at iofclose.c:84 etc. on older glibc versions. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
bwoebi
added a commit
that referenced
this pull request
May 24, 2024
It apparently leads to race conditions if libpthread and libc aren't loaded at the same time. In this case a library linking against libpthread is dlopen()'ed dynamically from the trampoline. It led to interesting libc memory corruptions, like in getaddrinfo: #2 0x00007fe45328df67 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7fe4533a05d0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:196 #3 0x00007fe453296329 in malloc_printerr (ar_ptr=0x7fe4535dc760 <main_arena>, ptr=<optimized out>, str=0x7fe4533a06d8 "double free or corruption (out)", action=3) at malloc.c:4967 #4 _int_free (av=0x7fe4535dc760 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3843 #5 0x00007fe453283247 in _IO_new_fclose (fp=0x7fe448001d20) at iofclose.c:84 etc. on older glibc versions. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
// TODO what does this imply in term of licensing, do we need to add the link to the original license Apache/MIT somewhere?
hyper
'sService<Uri>
to resolve UDS sockets into a stream.Motivation
This PR is motivated by a few things
reqwest
doesn't support UDS. There are multiple years old issues open on the repo asking if it is planned.reqwest
crate is the biggest contributor in term of size to the final artefact. By using a lower level we can remove a lot of the bloat generated (691.3KiB on 8.9MiB). The new artifact is 5.7MiB which is a 35% size reductionAdditional Notes
hyper doesn't support TLS natively. I added support for it through the
hyper-rustls
. By default therustls
feature for request uses webpki as root of trust, whereas withhyper-rustls
the default certificates are picked from the OS which is probably also saves some space.How to test the change?
I am still testing them