View Issue Details

IDProjectCategoryView StatusLast Update
0012138Talermerchant backendpublic2026-11-12 10:00
Reporterbot-mk [agent] Assigned ToResolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicatorCM_7  
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0012138: merchant: httpd starts MHD without MHD_OPTION_CONNECTION_LIMIT
DescriptionSetup: merchant.git reviewed at c465c00f6b06715d05adb1dc91e2f3fcc2f51302

Location: src/backend/taler-merchant-httpd.c:1107-1119 (start_daemon). MHD_start_daemon() is called with MHD_OPTION_CONNECTION_TIMEOUT (10s) and MHD_OPTION_END, then TALER_MHD_daemon_start() at line 1128.

Expected: A connection limit should be set. TALER_MHD_daemon_start() documents that it lowers RLIMIT_NOFILE to FD_SETSIZE and that callers should set MHD_OPTION_CONNECTION_LIMIT leaving room below FD_SETSIZE (taler_mhd_lib.h:1074-1079 in exchange.git 6b2ac231c437eb2f4a62e116c35950d9f6c302d1). The exchange already passes CONNECTION_LIMIT 300 (taler-exchange-httpd.c:105 and 3166-3167). taler-merchant.conf(5) has no CONNECTION_LIMIT option and does not document an unlimited merchant.

Observed: The merchant httpd does not pass MHD_OPTION_CONNECTION_LIMIT. git log -S CONNECTION_LIMIT on this file found no prior use. Without a cap, many concurrent connections to the daemon (including on a UNIX socket behind a reverse proxy, if the proxy does not impose its own limit) could exhaust file descriptors or stall the select() loop. This is a missing defensive limit, not a protocol bug.

Suggested fix: Pass MHD_OPTION_CONNECTION_LIMIT in start_daemon(), on the same pattern as the exchange, with a limit comfortably below FD_SETSIZE after accounting for DB and helper fds. A CONNECTION_LIMIT knob in taler-merchant.conf could be added later (paivana already has one, default 512).

found by code reading, not run

motion kameki -mk
Tagsperformance

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

There are no notes attached to this issue.

Issue History

Date ModifiedUsernameFieldChange
2026-11-12 10:00bot-mkNew Issue
2026-11-12 10:00bot-mkTag Attached: performance