-
Notifications
You must be signed in to change notification settings - Fork 20
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
Avoid need for sleeps after creating channel using API #100
Comments
@channingduan @SamYuan1990 What do you think? |
In my point of view, the reason for sleep: do you want admin-sdk api listen the result after each operator? so ... this kind of checking will handle by admin-sdk itself, so for user, just need to focus on their operators? any edge case been considered as timeout? replay attack? |
The chaincode API calls that submit transactions already waits for blocks to be committed before returning. This is handled by Fabric Gateway. Where channel API calls need to wait for blocks to commit, we could also make use of the Gateway API (or Gateway gRPC services directly if neccessary) to wait for commit of blocks, at least on the Gateway peer. Timeout can be controlled by the client-supplied Context. Note that the Gateway only checks that transactions are committed to the local peer ledger. This is generally sufficient since it prefers highest block height peers for subsequent invocations. I'm not sure if this is sufficient for all the channel operations. Anything is better than having to guess an arbitrary delay time after performing operations. It might be worth checking what the test-network scripts and/or existing CLI commands are doing. |
I think it's better for gateway to handle network related case (for ex timeout). for admin sdk, if all network through gateway, we can remove sleep timeout. |
Another option is that we provide an api interface to allow user inject their own "call back"(some thing as post action hook or in an AOP programming model of view, a hook after network IO to peer/order), and we implemented a default "call back"... |
And in most of case, for example, if user want to check a block been confirmed by multiple peers, all operators(not only channel creation) should checked among the same scope. Hence in fact, the "call back" did the similar logic as gateway sdk but targeting on multiple peers. |
Signed-off-by: Sam Yuan <[email protected]>
I just created a pr to see what if we removed sleep in our e2e test case. |
I was double checked fabric sample today I am not sure if a sleep wait is a best option for us or not? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The end-to-end test suite currently contains arbitrary sleeps to give the network time to become stable before completing chaincode lifecycle deployment. These sleeps only appear to be required when the channel is created using the admin API. When the channel is created using the test-network scripts, chaincode deployment seems to work without sleeps.
Maybe it would be good to either:
The text was updated successfully, but these errors were encountered: