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

Message handler concurrency #16

Open
mappum opened this issue May 4, 2018 · 1 comment
Open

Message handler concurrency #16

mappum opened this issue May 4, 2018 · 1 comment

Comments

@mappum
Copy link
Contributor

mappum commented May 4, 2018

Currently we pass messages to the app serially, blocking until the handler has returned a response. In the future, we will want to be able to handle messages concurrently, e.g. for processing checkTx requests in parallel for performance gains.

@KrishnaPG
Copy link

I have put a 10 second timer in checkTx (to simulate a database lookup / http call) as below:

  checkTx: (request) => {
    console.log("checkTx: ", request);
    return new Promise((resolve, reject) => {
      setTimeout(() => { console.log("resolving tx:", request); resolve({}); }, 10000);
    })
  }

Tendermint core started to error out on broadcastTxCommit:

Error on broadcastTxCommit   module=rpc err="Timed out waiting for tx to be included in a block"

When it is not erring out, It is still waiting for the 10 seconds to complete, before accept the next checkTx. So, if you have 10 users trying to call checkTx at the same time, and each one takes some time, then all the other will have to wait - the core is not accepting multiple checkTx calls simultaneously, it is waiting for the prior call to complete first.

Adding the ability to perform checkTx in parallel will remove that process bottleneck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants