Commit graph

66 commits

Author SHA1 Message Date
a73fd1ca50 Add a fibers-parallel test 2025-03-10 21:33:29 +00:00
47ff45d963 Abbreviate the fport_writer error message
From the web server.
2025-03-10 21:32:55 +00:00
710972691b Fix exception handling for the web server exception handler
Don't crash if it returns a response with invalid headers.
2025-03-08 18:43:44 +00:00
e3bc3c12b0 Add some helpers for handling request bodies 2025-03-08 10:15:25 +00:00
759ff87c0c Remove GUILE_AUTO_COMPILE=0 from test-env.in
As I'm not sure this helps with backtraces.
2025-03-08 10:14:54 +00:00
3841b452a4 Use guile-next and guile-fibers-next for development 2025-03-08 10:14:33 +00:00
4e33da98aa Fix some exception handling issues 2025-03-08 09:39:27 +00:00
3aab1be1e7 Revert "Use module-ref for make-base-operation"
This isn't working, with make-base-operation changing from part of a
macro to a procedure, I'm not sure how to maintain compatability. I
think just switching to guile-fibers-next everywhere is the approach
to take.

This reverts commit f41d1853ce.
2025-03-04 14:18:32 +00:00
a6c96aa1da Better handle the web server exception handler not returning 2 values 2025-03-03 10:56:36 +00:00
f41d1853ce Use module-ref for make-base-operation
As the implementation of this changed in fibers, and that's causing
issues here when mixing the version of fibers used for knots and
different versions of fibers.
2025-02-27 13:23:06 +00:00
21e328aebb Improve exception reporting 2025-02-27 13:22:36 +00:00
ed4113af51 Simplify and extend using the knots exception with stack 2025-02-27 13:22:36 +00:00
d8bc09755e Fix knots-exception? 2025-02-27 12:18:36 +00:00
60bfe0d7a3 Remove trailing whitespace 2025-02-27 12:07:16 +00:00
f549bee282 Improve thread pool exception logging 2025-02-26 10:07:54 +00:00
13f1118576 Use #f as the default web server connection-idle-timeout
As it's not efficient yet and seems to cause excessive memory use.
2025-02-20 14:20:25 +00:00
239cb88f93 Rework handling connection persistance in the web server
Change to setting the connection header in the response based on the
request, and then closing the connection in the server based on the
response headers.

Stop closing the response based on the response code, as I don't know
why this is necessary.
2025-02-20 13:42:12 +00:00
1fbd1f334a Fix exception origin in the knots web server 2025-02-19 17:34:45 +00:00
99245034ea Allow passing custom channels to fiberize
This allows customising the behevaiour, for example by using a queue.
2025-02-19 12:46:51 +00:00
ca3d5a1781 Fix handling of client-loop exceptions
Maybe other things can go wrong here, so log so that there's some
information available.
2025-02-19 12:44:47 +00:00
d597b77fcb Use the thread-pool record for the default timeout
Rather than a parameter.
2025-02-10 15:16:37 +00:00
6c083bdebd Use default io waiters in the thread pool
To allow creating thread pools from fibers.
2025-02-10 15:13:30 +00:00
ee2a93fbca Avoid needlessly setting the encoding 2025-02-07 17:02:37 +00:00
cb2085b684 Make more web server encoding tweaks 2025-02-07 16:09:42 +00:00
b0bb65dbed Tweak some web server exception handling 2025-02-07 10:54:59 +00:00
19c1fe235b Allow customising the web server read request exception handler 2025-02-07 10:48:50 +00:00
025449ea0d Remove the fiberize show-backtrace? option
This is no longer relevant now that the stack is added to the compound
exception.
2025-02-07 10:43:24 +00:00
b0d8618705 Fix exception handling for fibers-batch-map 2025-02-06 17:02:54 +00:00
7de5901a94 Simplify exception handling in the web server 2025-02-06 16:45:22 +00:00
6337103525 Remove the resource pool reply timeout
By being smarter about how long to wait for replies.
2025-02-04 13:16:38 +00:00
a11cd24e57 Improve resource pool performance when there are lots of waiters 2025-02-04 13:16:10 +00:00
aadbee0d0e Improve handling of idle resources in the resource pool 2025-02-04 11:13:15 +00:00
893299ba24 Start trying to improve exceptions and backtraces
When using knots utilities.
2025-02-03 15:44:51 +00:00
bddc6c04ad Fix idle resource removal in the resource pool 2025-02-03 12:16:16 +01:00
a2ab770536 Tweak resource pool backtraces 2025-02-03 12:16:07 +01:00
92bb4b8d85 Export the default-exception-handler 2025-02-03 12:06:10 +01:00
41974a6817 Rework handling of using a proc for the web server response body
To address encoding issues and improve exception handling.
2025-02-03 11:25:11 +01:00
40cf026ea4 Rework exception handling in the web server 2025-02-03 11:19:52 +01:00
dc98ef9dcc Improve exception reporting in the resource pool 2025-02-03 10:37:45 +01:00
823cd95628 Guard against the remove message not working 2025-02-03 09:55:57 +01:00
2910e66150 Fix issue with parallel creating resource pool resources 2025-02-02 11:29:25 +01:00
61451907a9 Improve resource pool destruction 2025-01-31 12:33:50 +01:00
eebb42e7a7 Default to an resource-pool add-resources-parallelism of 1
So that there aren't issues with concurrent resource addition, at
least by default.
2025-01-30 09:57:14 +01:00
c641c19ce4 Call web server exception handlers with the request
So that this can be used when reporting the exception.
2025-01-29 16:18:15 +00:00
b5cc5fd077 Make the web server buffer size configurable 2025-01-29 16:17:56 +00:00
c90cc88da7 Add fibers-promise-result-available? 2025-01-29 16:16:35 +00:00
c1796f0081 Update run-knots-web-server docstring 2025-01-25 18:17:38 +00:00
675d8c3258 Make the web server exception handler configurable 2025-01-25 18:16:27 +00:00
8805265243 Don't wait indefinitely for new requests in the web server
Inspired by the similar changes in Cuirass.
2025-01-25 18:16:27 +00:00
d2ee45581b Export the wait-until-port operations 2025-01-23 19:48:39 +01:00