Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max-wait property for each reaction with optional handler #206

Open
wants to merge 49 commits into
base: main
Choose a base branch
from

Conversation

erlingrj
Copy link
Collaborator

@erlingrj erlingrj commented Jan 28, 2025

This PR adds a max-wait property for each reaction with an optional STP violation handler.

It also redoes the startup phase of a federation. Instead of specifying a leader of the federation that selects a start tag, start tag is selected P2P with a simple gossip based algorithm. This PR sets the stage for later developing clock sync, transient federates, coordinates shutdown and voluntary leaving and rejoining.

Copy link
Contributor

github-actions bot commented Jan 28, 2025

Benchmark results after merging this PR:

Benchmark results

Performance:

PingPongUc:
Best Time: 145.240 msec
Worst Time: 146.395 msec
Median Time: 145.654 msec

PingPongC:
Best Time: 174.842 msec
Worst Time: 181.021 msec
Median Time: 175.797 msec

ReactionLatencyUc:
Best latency: 36378 nsec
Median latency: 60013 nsec
Worst latency: 91514 nsec

ReactionLatencyC:
Best latency: 30830 nsec
Median latency: 59896 nsec
Worst latency: 104897 nsec

Memory usage:

PingPongUc:
text data bss dec hex filename
39282 760 7888 47930 bb3a bin/PingPongUc

PingPongC:
text data bss dec hex filename
45826 880 360 47066 b7da bin/PingPongC

ReactionLatencyUc:
text data bss dec hex filename
28873 744 2144 31761 7c11 bin/ReactionLatencyUc

ReactionLatencyC:
text data bss dec hex filename
41536 848 360 42744 a6f8 bin/ReactionLatencyC

@erlingrj erlingrj marked this pull request as ready for review February 6, 2025 13:36
@erlingrj erlingrj changed the title [DRAFT] Add safe-to-assume-absent functionality Add max-wait property for each reaction with optional handler Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

Memory usage after merging this PR will be:

Memory Report

action_empty_test_c

from to increase (%)
text 60860 62316 2.39
data 752 752 0.00
bss 11360 12224 7.61
total 72972 75292 3.18

action_microstep_test_c

from to increase (%)
text 61731 63188 2.36
data 760 760 0.00
bss 11424 12288 7.56
total 73915 76236 3.14

action_overwrite_test_c

from to increase (%)
text 61568 63024 2.36
data 752 752 0.00
bss 11424 12288 7.56
total 73744 76064 3.15

action_test_c

from to increase (%)
text 61472 62928 2.37
data 760 760 0.00
bss 11424 12288 7.56
total 73656 75976 3.15

deadline_test_c

from to increase (%)
text 57102 58500 2.45
data 768 768 0.00
bss 10784 11648 8.01
total 68654 70916 3.29

delayed_conn_test_c

from to increase (%)
text 62464 63758 2.07
data 752 752 0.00
bss 10272 13056 27.10
total 73488 77566 5.55

event_payload_pool_test_c

from to increase (%)
text 18331 18331 0.00
data 624 624 0.00
bss 320 320 0.00
total 19275 19275 0.00

event_queue_test_c

from to increase (%)
text 27616 27806 0.69
data 736 736 0.00
bss 480 480 0.00
total 28832 29022 0.66

nanopb_test_c

from to increase (%)
text 42884 43346 1.08
data 904 1288 42.48
bss 320 320 0.00
total 44108 44954 1.92

port_test_c

from to increase (%)
text 62412 63674 2.02
data 752 752 0.00
bss 10272 12928 25.86
total 73436 77354 5.34

reaction_queue_test_c

from to increase (%)
text 27448 27587 0.51
data 736 736 0.00
bss 480 480 0.00
total 28664 28803 0.48

request_shutdown_test_c

from to increase (%)
text 61703 63159 2.36
data 752 752 0.00
bss 11424 12288 7.56
total 73879 76199 3.14

startup_test_c

from to increase (%)
text 56801 58098 2.28
data 760 760 0.00
bss 10784 11648 8.01
total 68345 70506 3.16

tcp_channel_test_c

from to increase (%)
text 96880 94900 -2.04
data 1256 1640 30.57
bss 21408 12960 -39.46
total 119544 109500 -8.40

timer_test_c

from to increase (%)
text 56692 58098 2.48
data 752 752 0.00
bss 10784 11648 8.01
total 68228 70498 3.33

@erlingrj erlingrj requested review from LasseRosenow and tanneberger and removed request for LasseRosenow February 11, 2025 15:49
Copy link
Contributor

Coverage after merging add-staa into main will be

65.48%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   action.c77.69%65.63%100%81.18%134–135, 24, 42–45, 48, 50–51, 54–56, 62–63, 70–72, 72, 72–75, 81–82, 93–94
   builtin_triggers.c90.91%70%100%96.77%14, 18, 40, 43
   connection.c77.33%51.16%100%86.73%10, 104, 11, 110, 123–124, 136–137, 14, 14, 143, 145–146, 148, 16–17, 21–22, 22, 22–23, 25, 27–28, 33, 48, 48, 48–49, 55, 60–62, 97
   environment.c76.98%53.13%92.31%83.95%110–111, 122–124, 14–15, 20, 24–26, 26, 26–28, 28, 28, 34–35, 44, 48–49, 55–56, 72–73, 77–78
   event.c95.35%92.86%100%96.15%14–15
   federated.c6.83%3.33%10%8.43%10, 100, 102, 102, 102–103, 105, 105, 105, 105, 105–106, 106, 106–108, 111, 111, 111–113, 115–116, 119, 12, 120–121, 121, 121–122, 122, 122–124, 126, 129, 13, 130, 132–136, 14, 140–142, 144, 144, 144, 146–149, 15, 150, 153, 153, 153–156, 159–160, 160, 160–161, 163–164, 167–168, 17, 17, 17, 173–174, 174, 174–175, 177, 179, 179, 179, 18, 18, 18, 180–182, 182, 182, 182, 182, 182–191, 191, 191–192, 194, 196–199, 20, 20, 20, 200–205, 209, 21, 212, 212, 212–214, 218, 22, 22, 22, 221–222, 222, 222, 222–227, 229, 23, 230–231, 233, 239, 24, 240–241, 254–255, 255, 255–256, 256, 256–257, 257, 257–258, 258, 258–259, 259, 259–260, 260, 260–261, 261, 261, 263, 263, 263–264, 264, 264–265, 265, 265–266, 266, 266–267, 267, 267, 269, 28–29, 33–34, 36–39, 41, 43, 43, 43–44, 44, 44–45, 45, 45–46, 46, 46, 49, 51–54, 56, 56, 56–59, 59, 59–60, 62, 64, 66, 66, 66–67, 71, 74–75, 75, 75–76, 78–79, 81, 85–86, 88–89, 9, 90, 93, 95–99
   logging.c88.52%83.33%100%89.36%25, 38–40, 47, 60–61
   network_channel.c69.23%62.50%100%70.59%42, 42, 42, 47–50, 59
   port.c74.68%42.86%100%91.49%10, 10, 10, 15, 15, 15–16, 22, 26, 31, 31–33, 33, 33–34, 45, 45, 45–46
   queues.c83.66%75.81%100%85.94%115–119, 122–123, 140, 145, 151, 24–26, 31, 31, 35–40, 63–64, 76–77, 87, 87, 91–96
   reaction.c71.43%54.55%100%80%15, 17, 21, 28–31, 31, 31–32, 42, 45, 47, 52–53, 53, 53–55, 55, 55–56, 73, 89–91, 91, 91–94, 94, 94–95
   reactor.c69.33%51.52%100%82.28%10, 101–102, 14–19, 22, 28, 30, 32–37, 37, 37–38, 38, 38, 43, 55, 58–59, 59, 59–60, 60, 60–61, 63, 77–78, 81–82, 82, 82–83, 83, 83–84, 86, 91
   serialization.c37.50%25%50%40%16–17, 26–27, 33–34, 34, 34–35, 37–38, 41–42, 42, 42–43, 45–46
   startup_coordinator.c0%0%0%0%100–101, 101, 101–103, 107, 109, 109, 109–111, 114, 114, 114–120, 123–125, 128–131, 134, 136, 138, 138, 138, 138, 138, 138–139, 142–143, 143, 143, 143, 143, 143, 143–146, 148–151, 153–155, 155, 155–160, 160, 160–161, 161, 161–162, 162, 162, 162, 162, 162, 162, 164, 164, 164, 166, 166, 166–168, 168, 168–170, 172–175, 175, 175–180, 182, 184–185, 187, 189, 189, 189, 189, 189, 189, 189–198, 198, 198–199, 20, 200–201, 204–208, 23–24, 24, 24, 26–28, 28, 28–29, 31, 31, 31, 33, 33, 33–34, 36, 38, 38, 38–39, 44, 44, 44–45, 48, 50–51, 54–56, 56, 56–58, 61, 61, 61–65, 65, 65, 67–68, 70, 72, 75–76, 76, 76, 76, 76, 79–82, 82, 82–84, 84, 84–88, 90–93, 96–97
   tag.c40.19%31.48%60%47.92%14, 14–15, 17, 17–18, 23–24, 24, 24, 24, 24–25, 27, 27, 27, 27, 27–28, 30, 30, 30–31, 33–34, 34, 34–35, 37, 37, 37, 37, 37–38, 40, 40, 40, 40, 40–41, 43, 53–54, 63, 63–64, 83–85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85–87, 89
   timer.c95%66.67%100%100%14, 25
   trigger.c100%100%100%100%
   util.c41.67%33.33%33.33%46.67%12–13, 13, 13–16, 18–20,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant