Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger a timeout response after waiting x seconds on RPC calls #5589

Open
ahamlat opened this issue Jun 13, 2023 · 1 comment
Open

Trigger a timeout response after waiting x seconds on RPC calls #5589

ahamlat opened this issue Jun 13, 2023 · 1 comment
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) RPC

Comments

@ahamlat
Copy link
Contributor

ahamlat commented Jun 13, 2023

Description

Besu does not trigger a timeout response after some time ex. 30 seconds. When running Eth_getLogs from earliest to latest, Geth responds "request timed out" after 30 seconds. Besu keeps running and hanging the thread. I see some RpcMethodTimeoutException errors got triggered in the logs but it didn't change the output, the client (the caller) was still waiting for a response.

Acceptance Criteria

  • Besu triggers a timeout response after x seconds, it could be 30 seconds as Geth, but also more

Steps to Reproduce (Bug)

Have a Besu synced node on mainnet and launch this RPC call

time curl -X POST --data '{
        "method": "eth_getLogs",
        "params": [
                {
                        "fromBlock": "earliest",
                        "toBlock": "latest",
                        "address": "0x5805883423da1deb9866b4ba6b3749b163d0b472",
                        "topics": [
                                "0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f",
                                "0x000000000000000000000000000000000000000000000000000000000086d862",
                                "0x0000000000000000000000000000000000000000000000000000000000001489"
                        ]
                }
        ],
        "id": 1,
        "jsonrpc": "2.0"
}' http://127.0.0.1:8545/

Compare the result with Geth.

Expected behavior: [What you expect to happen]
Trigger a timeout response after waiting x seconds on an RPC call

Actual behavior: [What actually happens]
The caller is waiting indefinitely on very slow calls

Frequency: [What percentage of the time does it occur?
100% on some very slow calls.

Versions (Add all that apply)

  • Software version: 23.4.0
  • Java version: openjdk 17.0.7 2023-04-18
  • OS Name & Version: Ubuntu 22.04.1 LTS (Jammy Jellyfish)
@ahamlat ahamlat added good first issue Good for newcomers RPC labels Jun 13, 2023
@jframe jframe added TeamChupa GH issues worked on by Chupacabara Team TeamGroot GH issues worked on by Groot Team TeamRevenant GH issues worked on by Revenant Team labels Jun 15, 2023
@vinaykhanchi712
Copy link

@ahamlat Please assign it to me.

@macfarla macfarla added P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) help wanted Extra attention is needed and removed TeamGroot GH issues worked on by Groot Team TeamRevenant GH issues worked on by Revenant Team TeamChupa GH issues worked on by Chupacabara Team labels Jul 22, 2024
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 22, 2024
…status

- Add verification for 408 (Request Timeout) status code on timeout
- Add verification for timer cancellation in timeout scenario
- Update successful execution test to verify timer cancellation
- Mock timerId retrieval from context

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly tested in both timeout and successful
execution scenarios, improving the test coverage and error handling for
the JsonRpcExecutorHandler.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 22, 2024
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 22, 2024
Removed temporary test code that was accidentally left in EthGetLogs.java.
This code was not intended for the final implementation.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 22, 2024
…status

- Add verification for 408 (Request Timeout) status code on timeout
- Add verification for timer cancellation in timeout scenario
- Update successful execution test to verify timer cancellation
- Mock timerId retrieval from context

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly tested in both timeout and successful
execution scenarios, improving the test coverage and error handling for
the JsonRpcExecutorHandler.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 22, 2024
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 22, 2024
Removed .run directory from Git tracking. This directory contains local IDE configuration files that should
not be part of the repository.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 23, 2024
Removed temporary test code that was accidentally left in EthGetLogs.java.
This code was not intended for the final implementation.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 23, 2024
…status

- Add verification for 408 (Request Timeout) status code on timeout
- Add verification for timer cancellation in timeout scenario
- Update successful execution test to verify timer cancellation
- Mock timerId retrieval from context

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly tested in both timeout and successful
execution scenarios, improving the test coverage and error handling for
the JsonRpcExecutorHandler.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 23, 2024
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 23, 2024
…status

- Add verification for 408 (Request Timeout) status code on timeout
- Add verification for timer cancellation in timeout scenario
- Update successful execution test to verify timer cancellation
- Mock timerId retrieval from context

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly tested in both timeout and successful
execution scenarios, improving the test coverage and error handling for
the JsonRpcExecutorHandler.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 23, 2024
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 23, 2024
Removed .run directory from Git tracking. This directory contains local IDE configuration files that should
not be part of the repository.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
Removed temporary test code that was accidentally left in EthGetLogs.java.
This code was not intended for the final implementation.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
…status

- Add verification for 408 (Request Timeout) status code on timeout
- Add verification for timer cancellation in timeout scenario
- Update successful execution test to verify timer cancellation
- Mock timerId retrieval from context

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly tested in both timeout and successful
execution scenarios, improving the test coverage and error handling for
the JsonRpcExecutorHandler.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
…status

- Add verification for 408 (Request Timeout) status code on timeout
- Add verification for timer cancellation in timeout scenario
- Update successful execution test to verify timer cancellation
- Mock timerId retrieval from context

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly tested in both timeout and successful
execution scenarios, improving the test coverage and error handling for
the JsonRpcExecutorHandler.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
Removed .run directory from Git tracking. This directory contains local IDE configuration files that should
not be part of the repository.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
cloudspores added a commit to cloudspores/besu that referenced this issue Aug 26, 2024
…a-timeout

# rebase onto main.

Issue hyperledger#5589
PR hyperledger#7469

Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) RPC
Projects
None yet
Development

No branches or pull requests

5 participants