Stay Safe under Panic: Affine Rust Programming with Multiparty Session Types

04/28/2022
by   Nicolas Lagaillardie, et al.
0

Communicating systems comprise diverse software components across networks. To ensure their robustness, modern programming languages such as Rust provide both strongly typed channels, whose usage is guaranteed to be affine (at most once), and cancellation operations over binary channels. For coordinating components to correctly communicate and synchronise with each other, we use the structuring mechanism from multiparty session types, extending it with affine communication channels and implicit/explicit cancellation mechanisms. This new typing discipline, affine multiparty session types (AMPST), ensures cancellation termination of multiple, independently running components and guarantees that communication will not get stuck due to error or abrupt termination. Guided by AMPST, we implemented an automated generation tool (MultiCrusty) of Rust APIs associated with cancellation termination algorithms, by which the Rust compiler auto-detects unsafe programs. Our evaluation shows that MultiCrusty provides an efficient mechanism for communication, synchronisation and propagation of the notifications of cancellation for arbitrary processes. We have implemented several usecases, including popular application protocols (OAuth, SMTP), and protocols with exception handling patterns (circuit breaker, distributed logging).

READ FULL TEXT

page 7

page 8

page 11

page 13

page 21

page 25

page 37

page 39

research
09/08/2018

Affine Sessions

Session types describe the structure of communications implemented by ch...
research
05/14/2021

Multiparty Session Types for Safe Runtime Adaptation in an Actor Language (Extended version)

Human fallibility, unpredictable operating environments, and the heterog...
research
09/14/2020

Statically Verified Refinements for Multiparty Protocols

With distributed computing becoming ubiquitous in the modern era, safe d...
research
08/02/2023

Termination in Concurrency, Revisited

Termination is a central property in sequential programming models: a te...
research
04/26/2021

A Session Subtyping Tool (Extended Version)

Session types are becoming popular and have been integrated in several m...
research
09/24/2021

Automated Modular Verification for Race-Free Channels with Implicit and Explicit Synchronization

Ensuring the correctness of software for communication centric programs ...
research
11/04/2022

This is not the End: Rethinking Serverless Function Termination

Elastic scaling is one of the central benefits provided by serverless pl...

Please sign up or login with your details

Forgot password? Click here to reset