Commit Graph
236 Commits
Author SHA1 Message Date
Mathieu Carbou 22a6988a28 pioarduino 53.03.10 2024-12-16 23:54:32 +01:00
Mathieu Carbou 5b9a754c95 v3.3.1 2024-12-16 21:37:52 +01:00
Mathieu Carbou 3a92cfc956 Merge pull request #34 from mathieucarbou/fixups
fix: _remove_events_with_arg() might probably leak mem on queue overflow
2024-12-16 21:37:07 +01:00
Emil Muratov 611559e59d fix: _remove_events_with_arg() might probably leak mem on queue overflow
it must free message's mem if failed to requeue the pointer
2024-12-17 00:12:46 +09:00
Mathieu Carbou b2f4477d47 v3.3.0 2024-12-15 18:17:42 +01:00
Mathieu Carbou 8e5c375245 Merge pull request #33 from mathieucarbou/coalescedq
Coalesce poll events on queue eviction
2024-12-15 18:15:00 +01:00
Mathieu Carbou a669f6b548 Merge branch 'main' into coalescedq 2024-12-15 17:46:02 +01:00
Mathieu Carbou c10ba6b1c7 update example 2024-12-15 17:08:05 +01:00
Mathieu Carbou c5af87aa55 update example 2024-12-15 17:07:41 +01:00
Mathieu Carbou a7c2468f54 update example 2024-12-15 17:01:06 +01:00
Mathieu Carbou 1ee08d0a1e update example 2024-12-15 17:00:32 +01:00
Mathieu Carbou 269124956a Applying clang formatting 2024-12-15 16:51:34 +01:00
Emil Muratov 7bfbb947d0 queue deadlock and congestion aviodance
- do not let `_remove_events_with_arg()` call to block on queue pertubation, otherwise it could deadlock

 - in any case do not block on adding LWIP_TCP_POLL event to the queue, it does not make much sense anyway
   due to poll events are repetitive

 - `_get_async_event()` will discard LWIP_TCP_POLL events when q gets filled up
   this will work in combination with throttling poll events when adding to the queue
   Poor designed apps and multiple parallel connections could flood the queue with interleaved poll events
   that can't be properly throttled or coalesced. So we can discard it in the eviction task after coalescing
   It will work in this way:
    - queue is up to 1/4 full - all events are entering the queue and serviced
    - queue is from 1/4 and up to 3/4 full - new poll events are throttled on enqueue with linear probability
    - queue is from 3/4 up to full top - all new poll events are ignored on enqueue and existing poll events
      already in the queue are discarded on eviction with linear probability giving away priority for all other
      events to be serviced. It is expected that on a new poll timer connection polls could reenter the queue
2024-12-15 17:25:29 +09:00
Emil Muratov 80b2733de5 make _async_service_task's watchdog constantly watching with periodic feed 2024-12-15 10:20:55 +09:00
Emil Muratov afa162b73a Coalesce poll events on queue eviction
Refer: https://github.com/mathieucarbou/ESPAsyncWebServer/discussions/165

Let's try to coalesce two (or more) consecutive poll events into one
this usually happens with poor implemented user-callbacks that are runs too long and makes poll events to stack in the queue
if consecutive user callback for a same connection runs longer that poll time then it will fill the queue with events until it deadlocks.
This is a workaround to mitigate such poor designs and won't let other events/connections to starve the task time.
It won't be effective if user would run multiple simultaneous long running callbacks due to message interleaving.
todo: implement some kind of fair dequeing or (better) simply punish user for a bad designed callbacks by resetting hog connections
2024-12-13 16:32:15 +09:00
Mathieu Carbou 9355538a8f v3.2.15 2024-12-11 19:59:42 +01:00
Mathieu Carbou 31b3452efb Code reformat according to clang file 2024-12-11 19:55:13 +01:00
Mathieu Carbou 362beab638 Merge pull request #32 from vortigont/queue_ctrl
throttle polling events when message queue gets filled up
2024-12-11 19:53:31 +01:00
Mathieu Carbou 8302dba2b8 Issue 169 2024-12-11 15:02:55 +01:00
Emil Muratov ba3fa2a2ca throttle polling events when message queue gets filled up
a proof of concept, might help on long/large responces with user callbacks

(cherry picked from commit 18bbb3318547bde7a34a84229227ea1f5b80cc72)
2024-12-11 11:34:51 +01:00
Mathieu Carbou 67f0fa607c update example doc 2024-12-11 11:34:41 +01:00
Mathieu Carbou a1f27e66ce update recommendations 2024-12-11 11:05:16 +01:00
Mathieu Carbou 4d3ea14bfe update client 2024-12-11 10:38:02 +01:00
Mathieu Carbou 212cbeeb91 Merge pull request #30 from mathieucarbou/clang
Added clang file
2024-12-10 23:58:32 +01:00
Mathieu Carbou 38def694f6 Merge branch 'main' into clang 2024-12-10 23:58:24 +01:00
Mathieu Carbou 8d3de953c4 Merge pull request #29 from mathieucarbou/lock
Fix missing lock/unlock around dns_gethostbyname
2024-12-10 23:58:09 +01:00
Mathieu Carbou 7a407a6d5c Added clang file 2024-12-10 22:45:36 +01:00
Mathieu Carbou e48f2a5db8 Fix missing lock/unlock around dns_gethostbyname 2024-12-10 22:44:18 +01:00
Mathieu Carbou ebf989fc44 Added clang file 2024-12-10 22:22:29 +01:00
Mathieu Carbou edb81edf5e Arduino Core 3.1.0 RC3 / ESP-IDF 5.3 2024-11-15 20:38:35 +01:00
Mathieu Carbou f4b81e56ff v3.2.14 2024-11-12 18:45:34 +01:00
Mathieu Carbou d250960259 Fix: Required to lock TCPIP core functionality
See: https://github.com/espressif/arduino-esp32/issues/10526#issuecomment-2471122550
2024-11-12 18:43:58 +01:00
Mathieu Carbou 48a37dedf6 v3.2.12 2024-10-27 08:39:34 +01:00
Mathieu Carbou 45b7ee826b Fix #27: Required to lock TCPIP core functionality 2024-10-27 08:37:58 +01:00
Mathieu Carbou c4eac0999d update readme 2024-10-27 08:31:56 +01:00
Mathieu Carbou 828e8d027e update readme 2024-10-27 01:09:05 +02:00
Mathieu Carbou 9e5fd7940d v3.2.11 2024-10-26 12:32:07 +02:00
Mathieu Carbou f5c902b9cf Merge pull request #28 from mathieucarbou/issue-27
Fix #27: Required to lock TCPIP core functionality
2024-10-26 12:31:32 +02:00
Mathieu Carbou bad4972734 Fix #27: Required to lock TCPIP core functionality
Ref:
- https://github.com/mathieucarbou/AsyncTCP/issues/27
- https://github.com/espressif/arduino-esp32/issues/10526
2024-10-26 12:30:38 +02:00
Mathieu Carbou f005448495 pioardiono 53.03.10-rc2 2024-10-25 22:51:29 +02:00
Mathieu Carbou e0af59060b v3.2.10 2024-10-13 11:38:27 +02:00
Mathieu Carbou d198248240 Fix _recv method 2024-10-13 11:28:15 +02:00
Mathieu Carbou b11bfff4fd added MAX_CLIENTS 2024-10-13 10:21:00 +02:00
Mathieu Carbou e8133fbd46 testing against a local jekyll server 2024-10-13 10:14:55 +02:00
Mathieu Carbou b5d869b70b Point to google 2024-10-13 10:10:21 +02:00
Mathieu Carbou 784df13d4b Try fix #26 again 2024-10-13 10:05:12 +02:00
Mathieu Carbou c9044bf859 v3.2.9 2024-10-12 20:58:59 +02:00
Mathieu Carbou b4a974dc31 Fix #26 2024-10-12 20:55:11 +02:00
Mathieu Carbou 665d34ca0b Domain move 2024-10-08 11:52:54 +02:00
Mathieu Carbou 91f0086735 v3.2.8 2024-10-07 14:31:40 +02:00