Interface on use of releaseContext and actual use differ, plus use of getContext/releaseContext doesn't seem correct within a worker #1590
Labels
bug
Something isn't working
component/core
Related to the core code-base
documentation
Related to the documentation
In the code and documentation the connector interface for the releaseContext method shows it takes no parameters, yet in the the code we see the worker actually does this
Also note that a context is both retrieved and released at 2 stages not 1.
Now the concept of the context is a bit vague but it is a way to prepare a connector for execution of a round and this is exactly what the fabric connector does by creating connections then dropping them after the round has finished which makes sense for 2. What doesn't make sense is it's use in 1
If this is about providing a context to the workload module then why is is released at the end of prepareTest ? It would mean that the context provided to the workload module is now not valid as the context created at prepareTest doesn't have to the be same as the context created when the round is executed. In the case of fabric although it won't be the same object, it will be an object that would equate to the one provided to the workload module but contains no useful information really so is irrelevant.
For ethereum, it never does anything in releaseContext, but creates a new context object which provides a lot of information and this may or may not equate to the same object between prepareTest and executeRound.
Given that prepareTest is always done before executeRound, surely it makes sense for the context to be obtained during or before prepareTest and only released after executeRound ? that should provide performance improvements to caliper and the connectors as it means that doing a load or work twice for no reason will be eliminated. It would also mean that the context provided to the workload is actually meaningful.
The text was updated successfully, but these errors were encountered: