• Home
  • Raw
  • Download

Lines Matching refs:fault

8 correctly under various fault conditions that may be difficult to arrange at
17 provides a simple but powerful api for targeted fault injection in any lws or
23 The basic idea is objects in the user code can choose to initialize "fault
27 Although these "fault contexts" can be embedded in objects directly at object
31 them at creation time. Eg, if you want to cause a fault in a wsi instantiated
40 ![Fault Injection Overview](../doc-assets/fault-injection.png)
42 A fault injection request is made in `lws_fi_t` objects, specifying the
43 fault name and whether, and how often to inject the fault.
45 The "fault context" objects `lws_fi_ctx_t` embedded in the creation info
60 ## Integrating fault injection conditionals into code in private lws code
63 fault to be injected, or 1 if the fault should be synthesized. If there is no
64 rule matching "name", the answer is always to not inject a fault, ie, returns 0.
70 on code operation since the user must also add the fault injection rules he
73 ## Integrating fault injection conditionals into user code with public apis
75 These public apis query the fault context in a wsi, lws_context, ss handle, or
77 1 if the conditions (eg, probability) are met and the fault should be injected.
81 the name of the fault rule they are checking.
100 `lws-minimal-http-client --fault-injection 'wsi/user_reject_at_est'`, causing
105 [2021/03/11 13:41:05:2776] W: lws_fi: Injecting fault unk->user_reject_at_est
113 ## Types of fault injection "when" strategy
120 |`LWSFI_ALWAYS`|Unconditionally inject the fault|
121 |`LWSFI_DETERMINISTIC`|after `pre` times without the fault, the next `count` times exhibit the faul…
122 |`LWSFI_PROBABILISTIC`|exhibit a fault `pre` percentage of the time|
123 |`LWSFI_PATTERN`|Reference `pre` bits pointed to by `pattern` and fault if the bit set, pointing to…
124 …nce `pre` bits pointed to by `pattern` and fault if the bit set, pointing to allocated array, free…
129 be overridden using `--fault-seed <decimal>`, and the effective PRNG seed is
144 ## Passing in fault injection rules
152 ## Directly applying fault contexts
171 attached to them at creation time, so the fault injection objects directly
177 fault names can be structured with a /path/ type namespace so objects created
196 `listenskt` fault on wsi created by the server vhost "myvhost", ie, it will
213 Since everything can be reached from the lws_context fault context, directly or
220 can take an additional `--fault-injection "...,..."` switch, which automatically
224 `lws-minimal-http-client --fault-injection "wsi/dnsfail"`
228 ### Specifying when to inject the fault
231 matches an object, the fault will be injected every time. It's also possible
232 to make the fault inject itself at a random probability, or in a cyclic pattern,
237 |`wsi/thefault`|lws_fi()|Inject the fault every time|
238 |`wsi/thefault(10%)`|lws_fi()|Randomly inject the fault at 10% probability|
239 |`wsi/thefault(.............X.X)`|lws_fi()|Inject the fault on the 14th and 16th try, every 16 trie…
245 The last example above does not decide whether to inject the fault via `lws_fi()`
247 fault processing, on a secondary fault injection name. For example you may have
248 a fault `myfault` you use with `lws_fi()` to decide when to inject the fault,
249 and then a second, related fault name `myfault_delay` to allow you to add code
250 to delay the fault action by some random amount of ms within an externally-
255 ## Well-known fault names in lws