This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: properly implement batchable checking
ClosedPublic

Authored by indygreg on Aug 10 2017, 2:47 AM.

Details

Summary

remoteiterbatcher (unlike remotebatcher) only supports batchable
commands. This claim can be validated by comparing their
implementations of submit() and noting how remoteiterbatcher assumes
the invoked method has a "batchable" attribute, which is set by
@peer.batchable.

remoteiterbatcher has a custom getitem that was trying to
validate that only batchable methods are called. However, it was only
validating that the called method exists, not that it is batchable.

This wasn't a big deal since remoteiterbatcher.submit() would raise
an AttributeError attempting to mtd.batchable(...).

Let's fix the check and convert it to ProgrammingError, which may
not have been around when this was originally implemented.

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

indygreg created this revision.Aug 10 2017, 2:47 AM
quark accepted this revision.Aug 11 2017, 3:37 AM
This revision was automatically updated to reflect the committed changes.