on ‎2023 Jun 30 9:38 AM
Hello,
i have some problems with this codesnipped:
private rfcPools: Map<RfcConnectionParameters, Pool> = new Map();
let pool = new Pool({connectionParameters: connectionParams});
this.rfcPools.set(connectionParams, pool);
client = (await pool.acquire()) as Client
doesn't that await could run forever if there is no client availabe at that time?
I am looking for an idea how I can identify inactive clients or clients which are stuck in a task and how I can release those clients such that I can acquire new one.
I am looking forward for some ideas
Request clarification before answering.
Hello Jonas,
Pool.acquire() will check if already open Client connection is already available in Pool. If not it will try to open new connection and return it back. If new connection could not be opened, like server limit of max number of open RFC connections exceeded, the exception is thrown. When the network is down, it takes up to 60 seconds to throw an error. If you experience waiting "forever" we need to investigate.
The client can be considered "inactive" when waiting too long for the response from server. Such client connection can be released using "cancel" method: https://github.com/SAP/node-rfc/blob/main/doc/usage.md#cancel-connection
There is also a "timeout" option, which can be configured for the client and/or for particular RFC call:
- https://github.com/SAP/node-rfc/blob/main/doc/usage.md#client-options
- https://github.com/SAP/node-rfc/blob/main/doc/usage.md#rfc-call-options
It either case, when timeout exceeded, the connection is canceled / released.
Hope this helps in your usage scenario
Best regards,
Srdjan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.