#858: the original 300ms budget silently self-terminated on real cold * starts (SQLite/mmap open under load), so augmentation never appeared in * real sessions (0/24 observed) while manual warm invocations worked. The * budget is now generous by default and env-configurable; the settings.json * hook "timeout" remains the outer backstop (and alone governs Windows, * where this whole in-process
| 74 | * hook "timeout" remains the outer backstop (and alone governs Windows, |
| 75 | * where this whole in-process deadline block is compiled out). */ |
| 76 | static int ha_deadline_ms(void) { |
| 77 | /* A value this reader cannot read gets the DEFAULT, never the floor. atoi |
| 78 | * used to answer 0 for a typo, 0 is below the minimum, and the clamp then |
| 79 | * handed back the shortest deadline the setting allows — the opposite of |
| 80 | * what somebody raising CBM_HOOK_DEADLINE_MS is asking for. */ |
| 81 | long v = 0; |
| 82 | if (!cbm_env_long("CBM_HOOK_DEADLINE_MS", &v)) { |
| 83 | return HA_DEADLINE_DEFAULT_MS; |
| 84 | } |
| 85 | if (v < HA_DEADLINE_MIN_MS) { |
| 86 | return HA_DEADLINE_MIN_MS; |
| 87 | } |
| 88 | if (v > HA_DEADLINE_MAX_MS) { |
| 89 | return HA_DEADLINE_MAX_MS; |
| 90 | } |
| 91 | return (int)v; |
| 92 | } |
| 93 | |
| 94 | static int g_ha_crumb_fd = -1; |
| 95 | static char g_ha_crumb_msg[160]; |
no test coverage detected