Issue:
Bug: Creating a payment will shutdown the server due to stack overflow



### Discussed in https://github.com/juspay/hyperswitch/discussions/4636

<div type='discussions-op-text'>

<sup>Originally posted by **Rudy-Zidan** May 14, 2024</sup>
When ever i try to run the hyperswitch-web a call to "create-payment-intent" being triggered which will fail for empty reason
from the server side i see the following logs:
```
hyperswitch-hyperswitch-server-1  | {"message":"[SERVER_WRAP - EVENT] router::services::api","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"INFO","target":"router::services::api","service":"router","line":1143,"file":"crates/router/src/services/api.rs","fn":"server_wrap","full_name":"router::services::api::server_wrap","time":"2024-05-13T20:54:41.169167836Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","flow":"PaymentsCreate","extra":{"headers":"{\"accept-encoding\": \"**MASKED**\", \"host\": \"**MASKED**\", \"connection\": \"**MASKED**\", \"content-length\": \"**MASKED**\", \"accept\": \"**MASKED**\", \"user-agent\": \"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)\", \"api-key\": \"**MASKED**\", \"content-type\": \"**MASKED**\"}","tag":"BeginRequest","payload":"PaymentsRequest { amount: Some(Value(2999)), currency: Some(USD), amount_to_capture: None, payment_id: Some(PaymentIntentId(\"pay_ey8XCkOrX9XWspjLqoTD\")), merchant_id: None, routing: None, connector: None, capture_method: Some(Automatic), authentication_type: Some(ThreeDs), billing: Some(Address { address: Some(AddressDetails { city: Some(\"San Fransico\"), country: Some(US), line1: Some(*** alloc::string::String ***), line2: Some(*** alloc::string::String ***), line3: Some(*** alloc::string::String ***), zip: Some(*** alloc::string::String ***), state: Some(*** alloc::string::String ***), first_name: Some(*** alloc::string::String ***), last_name: Some(*** alloc::string::String ***) }), phone: Some(PhoneDetails { number: Some(*** alloc::string::String ***), country_code: Some(\"+91\") }), email: None }), capture_on: None, confirm: Some(false), customer: None, customer_id: Some(\"hyperswitch_sdk_demo_id\"), email: Some(Email(***********************@gmail.com)), name: None, phone: None, phone_country_code: None, off_session: None, description: Some(\"Hello this is description\"), return_url: None, setup_future_usage: None, payment_method_data: None, payment_method: None, payment_token: None, card_cvc: None, shipping: Some(Address { address: Some(AddressDetails { city: Some(\"Banglore\"), country: Some(US), line1: Some(*** alloc::string::String ***), line2: Some(*** alloc::string::String ***), line3: Some(*** alloc::string::String ***), zip: Some(*** alloc::string::String ***), state: Some(*** alloc::string::String ***), first_name: Some(*** alloc::string::String ***), last_name: Some(*** alloc::string::String ***) }), phone: Some(PhoneDetails { number: Some(*** alloc::string::String ***), country_code: Some(\"+1\") }), email: None }), statement_descriptor_name: None, statement_descriptor_suffix: None, order_details: Some([OrderDetailsWithAmount { product_name: \"Apple iphone 15\", quantity: 1, amount: 2999, requires_shipping: None, product_img_link: None, product_id: None, category: None, brand: None, product_type: None }]), client_secret: None, mandate_data: None, customer_acceptance: None, mandate_id: None, browser_info: None, payment_experience: None, payment_method_type: None, business_country: None, business_label: None, merchant_connector_details: None, allowed_payment_method_types: None, business_sub_label: None, retry_action: None, metadata: Some(*** serde_json::value::Value ***), connector_metadata: Some(ConnectorMetadata { apple_pay: None, airwallex: None, noon: Some(NoonData { order_category: Some(\"applepay\") }) }), feature_metadata: None, payment_link: None, payment_link_config: None, profile_id: None, surcharge_details: None, payment_type: None, request_incremental_authorization: None, session_expiry: None, frm_metadata: None, request_external_three_ds_authentication: None, recurring_details: None }","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"pay_ey8XCkOrX9XWspjLqoTD","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[GET_OR_POPULATE_REDIS - EVENT] diesel_models::query::generics","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"DEBUG","target":"diesel_models::query::generics","service":"router","line":376,"file":"crates/diesel_models/src/query/generics.rs","fn":"get_or_populate_redis","full_name":"diesel_models::query::generics::get_or_populate_redis","time":"2024-05-13T20:54:41.200493378Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","flow":"PaymentsCreate","extra":{"query":"SELECT \"api_keys\".\"key_id\", \"api_keys\".\"merchant_id\", \"api_keys\".\"name\", \"api_keys\".\"description\", \"api_keys\".\"hashed_api_key\", \"api_keys\".\"prefix\", \"api_keys\".\"created_at\", \"api_keys\".\"expires_at\", \"api_keys\".\"last_used\" FROM \"api_keys\" WHERE (\"api_keys\".\"hashed_api_key\" = $1) -- binds: [HashedApiKey(\"0e1be6b9d0b81d7ad11a839e2a7c1e5a8b4c206c4cdb30fea9a2971415db42f1\")]","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"pay_ey8XCkOrX9XWspjLqoTD","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[PERFORM_LOCKING_ACTION - EVENT] Lock acquired for locking input LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None }","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"INFO","target":"router::core::api_locking","service":"router","line":83,"file":"crates/router/src/core/api_locking.rs","fn":"perform_locking_action","full_name":"router::core::api_locking::perform_locking_action","time":"2024-05-13T20:54:41.221458336Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","merchant_id":"merchant_1715629529","flow":"PaymentsCreate","extra":{"http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"pay_ey8XCkOrX9XWspjLqoTD","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[FIND_BUSINESS_PROFILE_BY_PROFILE_ID - EVENT] diesel_models::query::generics","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"DEBUG","target":"diesel_models::query::generics","service":"router","line":376,"file":"crates/diesel_models/src/query/generics.rs","fn":"find_business_profile_by_profile_id","full_name":"diesel_models::query::generics::find_business_profile_by_profile_id","time":"2024-05-13T20:54:41.223726670Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","merchant_id":"merchant_1715629529","flow":"PaymentsCreate","extra":{"query":"SELECT \"business_profile\".\"profile_id\", \"business_profile\".\"merchant_id\", \"business_profile\".\"profile_name\", \"business_profile\".\"created_at\", \"business_profile\".\"modified_at\", \"business_profile\".\"return_url\", \"business_profile\".\"enable_payment_response_hash\", \"business_profile\".\"payment_response_hash_key\", \"business_profile\".\"redirect_to_merchant_with_http_post\", \"business_profile\".\"webhook_details\", \"business_profile\".\"metadata\", \"business_profile\".\"routing_algorithm\", \"business_profile\".\"intent_fulfillment_time\", \"business_profile\".\"frm_routing_algorithm\", \"business_profile\".\"payout_routing_algorithm\", \"business_profile\".\"is_recon_enabled\", \"business_profile\".\"applepay_verified_domains\", \"business_profile\".\"payment_link_config\", \"business_profile\".\"session_expiry\", \"business_profile\".\"authentication_connector_details\" FROM \"business_profile\" WHERE (\"business_profile\".\"profile_id\" = $1) -- binds: [\"pro_54CtNmzvo0L4wQN9A2bT\"]","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"payment_intent_id = \"pay_ey8XCkOrX9XWspjLqoTD\"","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[FIND_BUSINESS_PROFILE_BY_PROFILE_ID - EVENT] diesel_models::query::generics","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"DEBUG","target":"diesel_models::query::generics","service":"router","line":376,"file":"crates/diesel_models/src/query/generics.rs","fn":"find_business_profile_by_profile_id","full_name":"diesel_models::query::generics::find_business_profile_by_profile_id","time":"2024-05-13T20:54:41.225574920Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","merchant_id":"merchant_1715629529","flow":"PaymentsCreate","extra":{"query":"SELECT \"business_profile\".\"profile_id\", \"business_profile\".\"merchant_id\", \"business_profile\".\"profile_name\", \"business_profile\".\"created_at\", \"business_profile\".\"modified_at\", \"business_profile\".\"return_url\", \"business_profile\".\"enable_payment_response_hash\", \"business_profile\".\"payment_response_hash_key\", \"business_profile\".\"redirect_to_merchant_with_http_post\", \"business_profile\".\"webhook_details\", \"business_profile\".\"metadata\", \"business_profile\".\"routing_algorithm\", \"business_profile\".\"intent_fulfillment_time\", \"business_profile\".\"frm_routing_algorithm\", \"business_profile\".\"payout_routing_algorithm\", \"business_profile\".\"is_recon_enabled\", \"business_profile\".\"applepay_verified_domains\", \"business_profile\".\"payment_link_config\", \"business_profile\".\"session_expiry\", \"business_profile\".\"authentication_connector_details\" FROM \"business_profile\" WHERE (\"business_profile\".\"profile_id\" = $1) -- binds: [\"pro_54CtNmzvo0L4wQN9A2bT\"]","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"payment_intent_id = \"pay_ey8XCkOrX9XWspjLqoTD\"","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[INSERT_ADDRESS_FOR_PAYMENTS - EVENT] diesel_models::query::generics","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"DEBUG","target":"diesel_models::query::generics","service":"router","line":85,"file":"crates/diesel_models/src/query/generics.rs","fn":"insert_address_for_payments","full_name":"diesel_models::query::generics::insert_address_for_payments","time":"2024-05-13T20:54:41.226624211Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","merchant_id":"merchant_1715629529","flow":"PaymentsCreate","extra":{"query":"INSERT INTO \"address\" (\"address_id\", \"city\", \"country\", \"line1\", \"line2\", \"line3\", \"state\", \"zip\", \"first_name\", \"last_name\", \"phone_number\", \"country_code\", \"customer_id\", \"merchant_id\", \"payment_id\", \"created_at\", \"modified_at\", \"updated_by\", \"email\") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, DEFAULT) -- binds: [\"add_3dJ36tWTY2E8KzBegwhi\", \"Banglore\", US, Encryption { inner: *** Encrypted data of length 36 bytes *** }, Encryption { inner: *** Encrypted data of length 35 bytes *** }, Encryption { inner: *** Encrypted data of length 35 bytes *** }, Encryption { inner: *** Encrypted data of length 36 bytes *** }, Encryption { inner: *** Encrypted data of length 34 bytes *** }, Encryption { inner: *** Encrypted data of length 34 bytes *** }, Encryption { inner: *** Encrypted data of length 31 bytes *** }, Encryption { inner: *** Encrypted data of length 37 bytes *** }, \"+1\", \"hyperswitch_sdk_demo_id\", \"merchant_1715629529\", \"pay_ey8XCkOrX9XWspjLqoTD\", 2024-05-13 20:54:41.226276836, 2024-05-13 20:54:41.226276836, \"postgres_only\"]","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"payment_intent_id = \"pay_ey8XCkOrX9XWspjLqoTD\"","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[INSERT_ADDRESS_FOR_PAYMENTS - EVENT] diesel_models::query::generics","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"DEBUG","target":"diesel_models::query::generics","service":"router","line":85,"file":"crates/diesel_models/src/query/generics.rs","fn":"insert_address_for_payments","full_name":"diesel_models::query::generics::insert_address_for_payments","time":"2024-05-13T20:54:41.231528295Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","merchant_id":"merchant_1715629529","flow":"PaymentsCreate","extra":{"query":"INSERT INTO \"address\" (\"address_id\", \"city\", \"country\", \"line1\", \"line2\", \"line3\", \"state\", \"zip\", \"first_name\", \"last_name\", \"phone_number\", \"country_code\", \"customer_id\", \"merchant_id\", \"payment_id\", \"created_at\", \"modified_at\", \"updated_by\", \"email\") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, DEFAULT) -- binds: [\"add_5XjpF5T4tDV7AP1wcqFH\", \"San Fransico\", US, Encryption { inner: *** Encrypted data of length 32 bytes *** }, Encryption { inner: *** Encrypted data of length 43 bytes *** }, Encryption { inner: *** Encrypted data of length 43 bytes *** }, Encryption { inner: *** Encrypted data of length 38 bytes *** }, Encryption { inner: *** Encrypted data of length 33 bytes *** }, Encryption { inner: *** Encrypted data of length 34 bytes *** }, Encryption { inner: *** Encrypted data of length 31 bytes *** }, Encryption { inner: *** Encrypted data of length 38 bytes *** }, \"+91\", \"hyperswitch_sdk_demo_id\", \"merchant_1715629529\", \"pay_ey8XCkOrX9XWspjLqoTD\", 2024-05-13 20:54:41.231505795, 2024-05-13 20:54:41.231505795, \"postgres_only\"]","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"payment_intent_id = \"pay_ey8XCkOrX9XWspjLqoTD\"","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  | {"message":"[INSERT_PAYMENT_INTENT - EVENT] diesel_models::query::generics","hostname":"9fda4b3f751e","pid":1,"env":"sandbox","version":"v1.108.0-dirty-a4c8ad3-2024-04-25T00:03:05.000000000Z","build":"0.1.0-a4c8ad3-2024-04-25T00:03:05.000000000Z-1.78.0-release-aarch64-unknown-linux-gnu","level":"DEBUG","target":"diesel_models::query::generics","service":"router","line":85,"file":"crates/diesel_models/src/query/generics.rs","fn":"insert_payment_intent","full_name":"diesel_models::query::generics::insert_payment_intent","time":"2024-05-13T20:54:41.232687545Z","request_id":"018f73bc-72fe-75ea-99b8-3b63e3f4cc19","request_method":"POST","request_url_path":"/payments","merchant_id":"merchant_1715629529","flow":"PaymentsCreate","extra":{"query":"INSERT INTO \"payment_intent\" (\"payment_id\", \"merchant_id\", \"status\", \"amount\", \"currency\", \"amount_captured\", \"customer_id\", \"description\", \"return_url\", \"metadata\", \"connector_id\", \"shipping_address_id\", \"billing_address_id\", \"statement_descriptor_name\", \"statement_descriptor_suffix\", \"created_at\", \"modified_at\", \"last_synced\", \"setup_future_usage\", \"off_session\", \"client_secret\", \"active_attempt_id\", \"business_country\", \"business_label\", \"order_details\", \"allowed_payment_method_types\", \"connector_metadata\", \"feature_metadata\", \"attempt_count\", \"profile_id\", \"merchant_decision\", \"payment_link_id\", \"payment_confirm_source\", \"updated_by\", \"surcharge_applicable\", \"request_incremental_authorization\", \"incremental_authorization_allowed\", \"authorization_count\", \"session_expiry\", \"fingerprint_id\", \"request_external_three_ds_authentication\") VALUES ($1, $2, $3, $4, $5, DEFAULT, DEFAULT, $6, DEFAULT, $7, DEFAULT, $8, $9, DEFAULT, DEFAULT, $10, $11, $12, DEFAULT, DEFAULT, $13, $14, DEFAULT, DEFAULT, $15, DEFAULT, $16, DEFAULT, $17, $18, DEFAULT, DEFAULT, DEFAULT, $19, DEFAULT, $20, DEFAULT, DEFAULT, $21, DEFAULT, DEFAULT) -- binds: [\"pay_ey8XCkOrX9XWspjLqoTD\", \"merchant_1715629529\", RequiresPaymentMethod, 2999, USD, \"Hello this is description\", *** serde_json::value::Value ***, \"add_3dJ36tWTY2E8KzBegwhi\", \"add_5XjpF5T4tDV7AP1wcqFH\", 2024-05-13 20:54:41.232288461, 2024-05-13 20:54:41.232288461, 2024-05-13 20:54:41.232288461, \"pay_ey8XCkOrX9XWspjLqoTD_secret_VMJKXn8hFbFOC424eAHo\", \"pay_ey8XCkOrX9XWspjLqoTD_1\", [*** serde_json::value::Value ***], Object {\"apple_pay\": Null, \"airwallex\": Null, \"noon\": Object {\"order_category\": String(\"applepay\")}}, 1, \"pro_54CtNmzvo0L4wQN9A2bT\", \"postgres_only\", Default, 2024-05-13 21:09:41.23227917]","http.scheme":"http","http.route":"/payments","http.client_ip":"172.26.0.1","http.target":"/payments","http.flavor":"1.1","payment_id":"payment_intent_id = \"pay_ey8XCkOrX9XWspjLqoTD\"","trace_id":"00000000000000000000000000000000","http.user_agent":"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)","http.method":"POST","otel.name":"HTTP POST /payments","lock_action":"Hold { input: LockingInput { unique_locking_key: \"pay_ey8XCkOrX9XWspjLqoTD\", api_identifier: Payments, override_lock_retries: None } }","otel.kind":"server","http.host":"localhost:8080"}}
hyperswitch-hyperswitch-server-1  |
hyperswitch-hyperswitch-server-1  | thread 'actix-server worker 3' has overflowed its stack
hyperswitch-hyperswitch-server-1  | fatal runtime error: stack overflow
hyperswitch-hyperswitch-server-1  |
hyperswitch-hyperswitch-server-1 exited with code 133
```

i checked my memory for docker container it only use 2GB and the configuration is 12 GB. 

same happens when i try it from the control center
<img width="1725" alt="Screenshot 2024-05-14 at 12 05 32 AM" src="https://github.com/juspay/hyperswitch/assets/19466376/376e1544-3008-49fe-97dd-67ff2cca9785">



Any ideas why?</div>

Pull request description:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
- Add a default `RUST_MIN_STACK` size in the docker images for router

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://github.com/juspay/hyperswitch/discussions/4636

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- generating a docker image locally and testing it

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Testing:

- generating a docker image locally and testing it

Patch:
diff --git a/Dockerfile b/Dockerfile
index e9591e5e9f2..a8697177716 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -61,7 +61,8 @@ ENV TZ=Etc/UTC \
     RUN_ENV=${RUN_ENV} \
     CONFIG_DIR=${CONFIG_DIR} \
     SCHEDULER_FLOW=${SCHEDULER_FLOW} \
-    BINARY=${BINARY}
+    BINARY=${BINARY} \
+    RUST_MIN_STACK=4194304
 
 RUN mkdir -p ${BIN_DIR}