Skip to content

Commit dbcdd48

Browse files
authored
Only use http1.1 (#189)
1 parent 61f93a6 commit dbcdd48

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

.github/workflows/build_and_test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
run: ulimit -a
3131

3232
- name: Build docker
33-
run: docker-compose -f docker/docker-compose.yml build --build-arg BASE_IMG=python:${{ matrix.python-version }} --no-cache
33+
run: docker compose -f docker/docker-compose.yml build --build-arg BASE_IMG=python:${{ matrix.python-version }} --no-cache
3434

3535
- name: Run unit tests
36-
run: docker-compose -f docker/docker-compose.yml run --rm unit-test
36+
run: docker compose -f docker/docker-compose.yml run --rm unit-test
3737

3838
- name: Run integration tests
39-
run: docker-compose -f docker/docker-compose.yml run --rm integration-test
39+
run: docker compose -f docker/docker-compose.yml run --rm integration-test
4040

4141
- name: Generate coverage html report with dynamic contexts
42-
run: docker-compose -f docker/docker-compose.yml run --rm coverage
42+
run: docker compose -f docker/docker-compose.yml run --rm coverage
4343

4444
- uses: actions/upload-artifact@v3
4545
with:

fauna/client/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def __init__(
180180
from fauna.http.httpx_client import HTTPXClient
181181
c = HTTPXClient(
182182
httpx.Client(
183-
http1=False,
184-
http2=True,
183+
http1=True,
184+
http2=False,
185185
timeout=httpx.Timeout(
186186
timeout=timeout_s,
187187
connect=connect_timeout_s,

fauna/http/httpx_client.py

+4-18
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,12 @@ def request(
7373
raise ClientError("Invalid URL Format") from e
7474

7575
try:
76-
return HTTPXResponse(self._send_with_retry(3, request))
77-
except (httpx.HTTPError, httpx.InvalidURL) as e:
78-
raise NetworkError("Exception re-raised from HTTP request") from e
79-
80-
def _send_with_retry(
81-
self,
82-
retryCount: int,
83-
request: httpx.Request,
84-
) -> httpx.Response:
85-
try:
86-
response = self._c.send(
76+
return HTTPXResponse(self._c.send(
8777
request,
8878
stream=False,
89-
)
90-
return response
91-
except httpx.TransportError as e:
92-
if retryCount == 0:
93-
raise e
94-
else:
95-
return self._send_with_retry(retryCount - 1, request)
79+
))
80+
except (httpx.HTTPError, httpx.InvalidURL) as e:
81+
raise NetworkError("Exception re-raised from HTTP request") from e
9682

9783
@contextmanager
9884
def stream(

0 commit comments

Comments
 (0)