File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33pub const RUNNER_CTL_FIFO : & str = "/tmp/runner.ctl.fifo" ;
44pub const RUNNER_ACK_FIFO : & str = "/tmp/runner.ack.fifo" ;
55
6+ /// Be very careful when changing this, as this will break support for integrations built with versions stricly lower than this.
7+ /// Any change of this should be planned ahead of time, with deprecation warnings, and the release
8+ /// of integrations supporting the new protocol version a significant amount of time before
9+ /// releasing the runner.
10+ pub const MINIMAL_SUPPORTED_PROTOCOL_VERSION : u64 = 1 ;
611pub const CURRENT_PROTOCOL_VERSION : u64 = 2 ;
712
13+ const _: ( ) = assert ! (
14+ MINIMAL_SUPPORTED_PROTOCOL_VERSION <= CURRENT_PROTOCOL_VERSION ,
15+ "MINIMAL_SUPPORTED_PROTOCOL_VERSION must be less than or equal to CURRENT_PROTOCOL_VERSION"
16+ ) ;
17+
818/// The different markers that can be set in the perf.data.
919///
1020/// `SampleStart/End`: Marks the start and end of a sampling period. This is used to differentiate between benchmarks.
Original file line number Diff line number Diff line change @@ -193,11 +193,20 @@ impl RunnerFifo {
193193 }
194194 FifoCommand :: SetVersion ( protocol_version) => {
195195 match protocol_version. cmp ( & runner_shared:: fifo:: CURRENT_PROTOCOL_VERSION ) {
196- Ordering :: Less => panic ! (
197- "Integration is using an incompatible protocol version ({protocol_version} < {}). Please update the integration to the latest version." ,
198- runner_shared:: fifo:: CURRENT_PROTOCOL_VERSION
199- ) ,
200- Ordering :: Greater => panic ! (
196+ Ordering :: Less => {
197+ if * protocol_version
198+ < runner_shared:: fifo:: MINIMAL_SUPPORTED_PROTOCOL_VERSION
199+ {
200+ bail ! (
201+ "Integration is using a version of the protocol that is smaller than the minimal supported protocol version ({protocol_version} < {}). \
202+ Please update the integration to a supported version.",
203+ runner_shared:: fifo:: MINIMAL_SUPPORTED_PROTOCOL_VERSION
204+ ) ;
205+ }
206+ self . send_cmd ( FifoCommand :: Ack ) . await ?;
207+ continue ;
208+ }
209+ Ordering :: Greater => bail ! (
201210 "Runner is using an incompatible protocol version ({} < {protocol_version}). Please update the runner to the latest version." ,
202211 runner_shared:: fifo:: CURRENT_PROTOCOL_VERSION
203212 ) ,
You can’t perform that action at this time.
0 commit comments