@@ -40,7 +40,6 @@ namespace cbdc::threepc::agent {
40
40
switch (m_state) {
41
41
// In these states we can start again from the beginning
42
42
case state::init:
43
- [[fallthrough]];
44
43
case state::begin_sent:
45
44
case state::begin_failed:
46
45
break ;
@@ -69,7 +68,6 @@ namespace cbdc::threepc::agent {
69
68
70
69
// Rollback first so we can start fresh
71
70
case state::function_get_sent:
72
- [[fallthrough]];
73
71
case state::function_get_failed:
74
72
case state::function_failed:
75
73
case state::function_started:
@@ -87,7 +85,6 @@ namespace cbdc::threepc::agent {
87
85
88
86
// End states, cannot re-run exec
89
87
case state::function_get_error:
90
- [[fallthrough]];
91
88
case state::commit_error:
92
89
case state::function_exception:
93
90
case state::finish_complete:
@@ -375,16 +372,7 @@ namespace cbdc::threepc::agent {
375
372
m_ticket_number.value (),
376
373
payload,
377
374
[this ](broker::interface::commit_return_type commit_res) {
378
- if (commit_res.has_value ()) {
379
- if (std::holds_alternative<
380
- runtime_locking_shard::shard_error>(
381
- commit_res.value ())) {
382
- auto err
383
- = std::get<runtime_locking_shard::shard_error>(
384
- commit_res.value ());
385
- }
386
- }
387
- handle_commit (commit_res);
375
+ handle_commit (std::move (commit_res));
388
376
});
389
377
if (!maybe_success) {
390
378
m_state = state::commit_failed;
@@ -491,34 +479,40 @@ namespace cbdc::threepc::agent {
491
479
// No results should be reported in these states, fatal bugs
492
480
case state::init:
493
481
m_log->fatal (" Result reported in initial state" );
482
+ // System terminated by fatal()
494
483
case state::begin_sent:
495
484
m_log->fatal (" Result reported in begin_sent state" );
485
+ // System terminated by fatal()
496
486
case state::function_get_sent:
497
487
m_log->fatal (" Result reported in function_get_sent state" );
488
+ // System terminated by fatal()
498
489
case state::commit_sent:
499
490
m_log->fatal (" Result reported in commit_sent state" );
491
+ // System terminated by fatal()
500
492
case state::finish_sent:
501
493
m_log->fatal (" Result reported in finish_sent state" );
494
+ // System terminated by fatal()
502
495
case state::function_started:
503
496
m_log->fatal (" Result reported in function_started state" );
497
+ // System terminated by fatal()
504
498
case state::rollback_sent:
505
499
m_log->fatal (" Result reported in rollback_sent state" );
500
+ // System terminated by fatal()
506
501
case state::rollback_complete:
507
502
if (!std::holds_alternative<error_code>(m_result.value ())
508
503
|| std::get<error_code>(m_result.value ())
509
504
!= error_code::retry) {
510
505
m_log->fatal (" Result reported in rollback_complete state "
511
506
" when result is not retry" );
512
507
}
513
- [[fallthrough]] ;
508
+ break ;
514
509
515
510
// Failure due to transient problems, should retry
516
511
case state::begin_failed:
517
512
// Couldn't get a ticket number, no need to rollback
518
513
break ;
519
514
520
515
case state::function_get_failed:
521
- [[fallthrough]];
522
516
case state::function_failed:
523
517
case state::commit_failed:
524
518
do_rollback (false );
@@ -534,7 +528,6 @@ namespace cbdc::threepc::agent {
534
528
535
529
// Failure due to permanent error, abort completely
536
530
case state::function_get_error:
537
- [[fallthrough]];
538
531
case state::commit_error:
539
532
case state::function_exception:
540
533
do_rollback (true );
0 commit comments