peer.commandexecutor()'s context manager waits for all responses to
arrive in its exit() method. When batching requests, one often
wants to process the requests as they arrive. That means one has to
call future.result() before exiting the command executor's context
manager. It doesn't matter in practice here (where we batch only
"heads" and "known" and don't care to process either until both
responses have arrived), but let's make this code a good example for
others who may want to copy the pattern.
Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHG63c2b44bbe60: setdiscovery: access future.result() inside command executor
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
I'm going to drop this from hg-committed because it introduces deadlock in test-http-bad-server.t.
The deadlock is due to buggy future handling in (at least) httppeer. I'll keep this patch in my local queue and will try to hack on a fix for the peer.