Hello everyone :wave: I'm reading about the can-i-...
# pact-broker
m
Hello everyone đź‘‹ I'm reading about the can-i-deploy feature and one thing keeps on bothering me: Are record-deployment and can-i-deploy resilient to race conditions in any way? The deployment of a service takes some time, so there is a time gap between a check with can-i-deploy and the record-deployment commands. It could happen that e.g. a consumer thinks it's safe to deploy and right after it starts rolling out to an environment, a potentially incompatible provider version does just the same: it checks for compatibility, but with the old consumer version and not the one that is just being deployed (because its deployment is still ongoing) and also proceeds with the deployment. This way two incompatible consumer and provider instances could get deployed into an environment. I haven't found anything about that in the documenation or in the Slack history.
b
afaik, all of those commands (both checks and recordings, i.e.
can-i-deploy
,
record-deployment
,
record-release
, etc) are all immediate, and there aren't any locks or mutexes . . . (because how could this tooling know about every env setup)
but I think the practical solution irl is to talk to each other, and have several versions deployed (in different envs) at the same time, which increases the chance that many parallel versions are compatible
(the tooling doesn't 100% protect you, and it's not trying to—it's a helper and conversation point)
m
Another way to reduce the likelihood of this issue, is to always check compatibility with both the mainline and production version of an application (or as the case may be, the previous environment and next environment). This would mean both applications are pairwise compatible with the various combinations, and so a long running deployment wouldn’t cause an issue