diff --git a/src/Pkg/Queue.hs b/src/Pkg/Queue.hs index b5cd97045..8b01c47b1 100644 --- a/src/Pkg/Queue.hs +++ b/src/Pkg/Queue.hs @@ -470,6 +470,11 @@ kafkaService appLogger appCtx tp role label kafkaTopics batchSize fn = checkpoin -- round-trip cost). 250ms stays well under session/poll timeouts. <> K.extraProp "fetch.min.bytes" "65536" <> K.extraProp "fetch.wait.max.ms" "250" + -- Fetch ceiling must match broker 64 MiB max.message.bytes, else an oversized-but-valid + -- record (e.g. a header-restamped DLQ re-publish) wedges the partition with MSG_SIZE_TOO_LARGE. + <> K.extraProp "max.partition.fetch.bytes" "67108864" -- 64 MiB (librdkafka default 1 MiB) + <> K.extraProp "fetch.max.bytes" "67108864" -- 64 MiB total per fetch (default 50 MiB) + <> K.extraProp "receive.message.max.bytes" "104857600" -- 100 MiB socket buffer (> fetch.max.bytes) <> K.extraProp "partition.assignment.strategy" "cooperative-sticky" <> K.extraProp "group.instance.id" clientId <> K.logLevel K.KafkaLogInfo diff --git a/test/unit/System/ServerSpec.hs b/test/unit/System/ServerSpec.hs index 425206ef4..5a400dd72 100644 --- a/test/unit/System/ServerSpec.hs +++ b/test/unit/System/ServerSpec.hs @@ -1,6 +1,8 @@ module System.ServerSpec (spec) where +import Control.Concurrent (threadDelay) import Control.Concurrent.Async (async, race, wait) +import Control.Exception (catch, finally) import Relude import System.Server (cancelAllConcurrently) import Test.Hspec