Skip to content

Commit 6d6f5c5

Browse files
authored
⚗️ Increases timeout of rpc calls (#6326)
1 parent 9f06e36 commit 6d6f5c5

File tree

3 files changed

+15
-3
lines changed
  • packages/service-library/src/servicelib/rabbitmq
  • services/web/server/src/simcore_service_webserver/payments

3 files changed

+15
-3
lines changed

packages/service-library/src/servicelib/rabbitmq/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ._client import RabbitMQClient
44
from ._client_rpc import RabbitMQRPCClient
5-
from ._constants import BIND_TO_ALL_TOPICS
5+
from ._constants import BIND_TO_ALL_TOPICS, RPC_REQUEST_DEFAULT_TIMEOUT_S
66
from ._errors import (
77
RemoteMethodNotRegisteredError,
88
RPCNotInitializedError,
@@ -17,6 +17,7 @@
1717
"RabbitMQClient",
1818
"RabbitMQRPCClient",
1919
"RemoteMethodNotRegisteredError",
20+
"RPC_REQUEST_DEFAULT_TIMEOUT_S",
2021
"RPCNamespace",
2122
"RPCNotInitializedError",
2223
"RPCRouter",

packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog/services.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def _call(
5454
user_id=user_id,
5555
limit=limit,
5656
offset=offset,
57-
timeout_s=10 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
57+
timeout_s=20 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
5858
)
5959

6060
result = await _call(
@@ -94,7 +94,7 @@ async def _call(
9494
user_id=user_id,
9595
service_key=service_key,
9696
service_version=service_version,
97-
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
97+
timeout_s=4 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
9898
)
9999

100100
result = await _call(

services/web/server/src/simcore_service_webserver/payments/_rpc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from models_library.wallets import WalletID
2424
from pydantic import EmailStr, HttpUrl, parse_obj_as
2525
from servicelib.logging_utils import log_decorator
26+
from servicelib.rabbitmq import RPC_REQUEST_DEFAULT_TIMEOUT_S
2627

2728
from ..rabbitmq import get_rabbitmq_rpc_client
2829

@@ -64,6 +65,7 @@ async def init_payment( # pylint: disable=too-many-arguments
6465
stripe_price_id=stripe_price_id,
6566
stripe_tax_rate_id=stripe_tax_rate_id,
6667
comment=comment,
68+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
6769
)
6870
assert isinstance(result, WalletPaymentInitiated) # nosec
6971
return result
@@ -85,6 +87,7 @@ async def cancel_payment(
8587
payment_id=payment_id,
8688
user_id=user_id,
8789
wallet_id=wallet_id,
90+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
8891
)
8992

9093

@@ -106,6 +109,7 @@ async def get_payments_page(
106109
product_name=product_name,
107110
limit=limit,
108111
offset=offset,
112+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
109113
)
110114
assert ( # nosec
111115
parse_obj_as(tuple[int, list[PaymentTransaction]], result) is not None
@@ -129,6 +133,7 @@ async def get_payment_invoice_url(
129133
user_id=user_id,
130134
wallet_id=wallet_id,
131135
payment_id=payment_id,
136+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
132137
)
133138
return result
134139

@@ -153,6 +158,7 @@ async def init_creation_of_payment_method(
153158
user_id=user_id,
154159
user_name=user_name,
155160
user_email=user_email,
161+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
156162
)
157163
assert isinstance(result, PaymentMethodInitiated) # nosec
158164
return result
@@ -174,6 +180,7 @@ async def cancel_creation_of_payment_method(
174180
payment_method_id=payment_method_id,
175181
user_id=user_id,
176182
wallet_id=wallet_id,
183+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
177184
)
178185
assert result is None # nosec
179186

@@ -192,6 +199,7 @@ async def list_payment_methods(
192199
parse_obj_as(RPCMethodName, "list_payment_methods"),
193200
user_id=user_id,
194201
wallet_id=wallet_id,
202+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
195203
)
196204
assert isinstance(result, list) # nosec
197205
return result
@@ -213,6 +221,7 @@ async def get_payment_method(
213221
payment_method_id=payment_method_id,
214222
user_id=user_id,
215223
wallet_id=wallet_id,
224+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
216225
)
217226
assert isinstance(result, PaymentMethodGet) # nosec
218227
return result
@@ -234,6 +243,7 @@ async def delete_payment_method(
234243
payment_method_id=payment_method_id,
235244
user_id=user_id,
236245
wallet_id=wallet_id,
246+
timeout_s=2 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
237247
)
238248
assert result is None # nosec
239249

@@ -274,6 +284,7 @@ async def pay_with_payment_method( # noqa: PLR0913 # pylint: disable=too-many-a
274284
stripe_price_id=stripe_price_id,
275285
stripe_tax_rate_id=stripe_tax_rate_id,
276286
comment=comment,
287+
timeout_s=3 * RPC_REQUEST_DEFAULT_TIMEOUT_S,
277288
)
278289

279290
assert isinstance(result, PaymentTransaction) # nosec

0 commit comments

Comments
 (0)