2298 Commits

Author SHA1 Message Date
HoneyryderChuck
ca6fa4605b sentry: do not propagate trace when sdk options are not set correctly 2023-11-12 15:42:26 +00:00
HoneyryderChuck
1bebb179ce load httpx sentry patch for tests 2023-11-12 15:31:38 +00:00
HoneyryderChuck
8632da0a22 name sentry patch 2023-11-12 12:06:42 +00:00
HoneyryderChuck
a864db0182 CI: support recent localstack health payloadd change 2023-11-12 11:31:45 +00:00
HoneyryderChuck
fcf41b990e fix super call in sentry adapter 2023-11-10 18:28:55 +00:00
HoneyryderChuck
4c01dd0b9b do not force to close a connection which has been closed already 2023-11-06 23:34:10 +00:00
HoneyryderChuck
bea2c4d5c6 eden connections should only reset to idle once they are picked up 2023-11-06 23:33:55 +00:00
HoneyryderChuck
f442e81414 bump version to 1.1.1 v1.1.1 2023-11-06 17:17:05 +00:00
HoneyryderChuck
18f2bea9b0 Merge branch 'issue-261' into 'master'
reset timer baseline interval when adding new timers

Closes #261

See merge request os85/httpx!290
2023-11-06 16:36:53 +00:00
HoneyryderChuck
f6bee9e6e4 Merge branch 'issue-257' into 'master'
DNS retries to native resolver

Closes #257

See merge request os85/httpx!293
2023-11-06 12:03:52 +00:00
HoneyryderChuck
d9a52ec795 readding DNS retries to native resolver
when they fail once, the whole thing crumbles, which breaks rate limit strategies from some known software

Fixes #257
2023-11-06 09:56:40 +00:00
Nogweii
4b074a6d8a fix squid crashing on my Arch laptop 2023-11-04 16:55:11 +00:00
HoneyryderChuck
791a94322f resolver: fix for when nested lookup call returns nil 2023-11-04 16:54:59 +00:00
HoneyryderChuck
3cd063b153 Merge branch 'issue-gh-18' into 'master'
Fix close callback leak

See merge request os85/httpx!289
2023-11-04 16:35:01 +00:00
HoneyryderChuck
9a64fadb56 updating example scripts 2023-11-04 16:22:53 +00:00
HoneyryderChuck
e178bc9f20 remove duplicated conn close handler, it's set already in init_connection 2023-11-04 16:22:53 +00:00
HoneyryderChuck
4ef2d9c3ce do not remove ivars anymore 2023-11-04 16:22:53 +00:00
HoneyryderChuck
39d0356340 no consumer of connection reset event, so no emission required 2023-11-04 02:22:32 +00:00
HoneyryderChuck
1e05cdbe62 http/1.1 fix: close connection even if the server does not respect connectionn: close in request 2023-11-04 02:21:03 +00:00
HoneyryderChuck
e27301013d patching the setup of the on close callback instead
the previous patch allowed the callback to be called only once, whereas this one will be long-lived for the duration of the connection
2023-11-03 22:48:55 +00:00
HoneyryderChuck
f477871bfa reset timer baseline interval when adding new timers
due to how read timeouts are added on request transitions, timers may
enter the pool **before** a new tick happens, and are therefore
accounted for when the timers are fired after the current tick.

This patch resets the timer, which will force a new tick before they may
fire again.
2023-11-03 12:12:05 +00:00
HoneyryderChuck
fac8a62037 bail out on dns answer when connection already closed
there are situations where a connection may already be closed before dns response is received for it. such an example is connection coalescing, when happy eyeballs takes over, first address arrives, a coalescing situation is detected, and then the connection and it's happy eyeballs cousin are both closed, **before** the cound connection has been resolved
2023-11-02 23:11:27 +00:00
Thomas Hurst
ec7b845c67 Fix close callback leak
Per Github issue #18, this causes a linear performance decrease, with
each connection slightly slowing the next.
2023-11-02 02:00:01 +00:00
HoneyryderChuck
ce07b2ff50 bumped version to 1.1.0 v1.1.0 2023-10-30 11:27:20 +00:00
HoneyryderChuck
c2bd6c8540 Merge branch 'issue-260' into 'master'
add support in json mime type checker for application/hal+json

Closes #260

See merge request os85/httpx!288
2023-10-30 10:35:28 +00:00
HoneyryderChuck
1aa2b08db7 add support in json mime type checker for application/hal+json 2023-10-30 10:27:32 +00:00
HoneyryderChuck
14c94e6d14 Merge branch 'issue-251' into 'master'
Add Response#peer_address and ErrorResponse#peer_address

Closes #251

See merge request os85/httpx!286
2023-10-30 10:13:52 +00:00
HoneyryderChuck
8f54afe7b3 Merge branch 'issue-252' into 'master'
test for follow redirect with relative paths

Closes #252

See merge request os85/httpx!287
2023-10-30 10:13:42 +00:00
HoneyryderChuck
9465a077b1 Add Response#peer_address and ErrorResponse#peer_address
responses can now expose the IP address used to connect to the peer
server to fetch the response from.
2023-10-30 09:52:30 +00:00
HoneyryderChuck
168e530dab tolerate not having openssl installed 2023-10-29 22:56:37 +00:00
HoneyryderChuck
159fa74a3f add test to verify that redirect plugin can follow relative and with .. paths 2023-10-29 22:46:45 +00:00
HoneyryderChuck
5bb74ec465 expose the io object via the TCP#socket method, which will be an SSLSocket for SSL case 2023-10-29 22:34:39 +00:00
HoneyryderChuck
949bcdbc2a Merge branch 'issue-255' into 'master'
Fixing timeouts performance regression

See merge request os85/httpx!282
2023-10-28 22:30:14 +00:00
HoneyryderChuck
ceaa994eba patch jruby until 9.4.5.0 is released 2023-10-27 18:19:59 +01:00
HoneyryderChuck
489c7280ec cleaned up timeout setup logic by usign a shared function for the set/unset phases 2023-10-25 07:44:40 +01:00
HoneyryderChuck
c5fc8aeb19 simplify initialization of request buffer 2023-10-25 07:44:40 +01:00
HoneyryderChuck
d5e469d6c6 removing threshold size var from req body 2023-10-25 07:44:40 +01:00
HoneyryderChuck
bc99188c80 adding persistent= setter to Request
this avoids the creation of another options object
2023-10-25 07:44:40 +01:00
HoneyryderChuck
6176afbf2c removing unneeded var 2023-10-24 22:53:59 +01:00
HoneyryderChuck
1cc9d4f04b fixing recovering from exhausted connections for HTTP/1
this has been working for a while, but was silently failing in HTTP/1, due to our inability to test it in CI (HTTP/1 setup is not yet using keep-alive)
2023-10-24 22:53:22 +01:00
HoneyryderChuck
62217f6a76 added connect nonblock state to internal logs 2023-10-24 22:53:22 +01:00
HoneyryderChuck
e4facd9b7a defaulting max requests to infinity
this limit wasn't doing any favours to anyone, particularly during benchmmarks
2023-10-24 22:53:22 +01:00
HoneyryderChuck
ba8b4a4bc9 optimization: try connecting on #call
this avoids a needless select syscall on connection establishment
2023-10-24 22:53:22 +01:00
HoneyryderChuck
82a0c8cf11 fix faraaday adapter timeout setup
do not set them all as operation timeout
2023-10-24 22:53:22 +01:00
HoneyryderChuck
bdc9478aa8 do not use INFINITY for timeouts
it isn't a valid input for IO#wait family of functions; instead, use nil
2023-10-24 22:53:22 +01:00
HoneyryderChuck
8bd4dc1fbd fix timers overhead causing spurious wakeups on the select loop
the change to read/write cancellation-driven timeouts as the default
timeout strategy revealed a performance regression; because these were
built on Timers, which never got unsubscribed, this meant that they were
kept beyond the duration of the request they were created for, and
needlessly got picked up for the next timeout tick.

This was fixed by adding a callback on timer intervals, which
unsubscribes them from the timer group when called; these would then be
activated after the timeout is not needed anymore (request send /
response received), thereby removing the overhead on subsequent
requests.

An additional intervals array is also kept in the connection itself;
timeouts from timers are signalled via socket wait calls, however they
were always resulting in timeouts, even when they shouldn't (ex: expect
timeout and send full response payload as a result), and with the wrong
exception class in some cases. By keeping intervals from its requests
around, and monitoring whether there are relevant request triggers, the
connection can therefore handle a timeout or bail out (so that timers
can fire the correct callback).
2023-10-24 22:53:22 +01:00
HoneyryderChuck
dbc7536724 fix for timeouts performance regression
since v1, performance has regressed due to the new default timeouts,
which are based on timers. That's because they were not being cleanup
after requests were done with, and were causing spurious wakeups in the
select loop after the fact.

Fixed by cleaning up each timer after each relevant request event.
2023-10-24 22:53:22 +01:00
HoneyryderChuck
062109a5bc Merge branch 'doc-improvements' into 'master'
doc to most public accessible classes

See merge request os85/httpx!279
2023-10-24 16:05:34 +00:00
HoneyryderChuck
09a3df54c4 Merge branch 'issue-github-19' into 'master'
set ndots to 1 when none parsed from resolv.conf

See merge request os85/httpx!283
2023-10-24 14:04:54 +00:00
Jonas Mueller
554b5a663c Return domain name early if ASCII only 2023-10-24 15:00:11 +01:00