{"record":{"id":"6900f3e2484ae22c","repo":"aeron-io/aeron","slug":"publication-window-length-pubwindow-must-not-exceed-half-the","errorCode":null,"errorMessage":"publication-window-length={pubWindow} must not exceed half the term-length={termLength}","messagePattern":"publication-window-length=(.+?) must not exceed half the term-length=(.+?)","errorType":"validation","errorClass":"InvalidChannelException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java","lineNumber":184,"sourceCode":"        return params;\n    }\n\n    private void getPublicationWindowLength(final ChannelUri channelUri, final MediaDriver.Context ctx)\n    {\n        final String pubWindowParam = channelUri.get(PUBLICATION_WINDOW_LENGTH_PARAM_NAME);\n        if (null != pubWindowParam)\n        {\n            final long pubWindow = SystemUtil.parseSize(PUBLICATION_WINDOW_LENGTH_PARAM_NAME, pubWindowParam);\n            if (pubWindow < mtuLength)\n            {\n                throw new InvalidChannelException(\n                    PUBLICATION_WINDOW_LENGTH_PARAM_NAME + \"=\" + pubWindow + \" cannot be less than the \" +\n                    MTU_LENGTH_PARAM_NAME + \"=\" + mtuLength);\n            }\n\n            if (pubWindow > (termLength >> 1))\n            {\n                throw new InvalidChannelException(\n                    PUBLICATION_WINDOW_LENGTH_PARAM_NAME + \"=\" + pubWindow + \" must not exceed half the \" +\n                    TERM_LENGTH_PARAM_NAME + \"=\" + termLength);\n            }\n            publicationWindowLength = (int)pubWindow;\n        }\n        else\n        {\n            publicationWindowLength = Configuration.producerWindowLength(\n                termLength,\n                channelUri.isIpc() ? ctx.ipcPublicationTermWindowLength() : ctx.publicationTermWindowLength());\n        }\n    }\n\n    private void getStreamId(final ChannelUri channelUri, final int streamId)\n    {\n        final String streamIdParam = channelUri.get(STREAM_ID_PARAM_NAME);\n        if (null != streamIdParam)\n        {","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java#L166-L202","documentation":"publication-window-length must not exceed half the term-length; a window larger than half a term buffer would let the producer overrun the consumer position into the next term and break flow-control invariants. Aeron rejects such values with InvalidChannelException.","triggerScenarios":"A channel URI where publication-window-length > termLength/2 (e.g. publication-window-length=2m with term-length=1m, or a shrunken term-length like term-length=64k with default 1MB window param).","commonSituations":"Reducing term-length for low-latency small-message channels without adjusting the window; typos in size units (m vs k) in the URI; copying a window value from a driver-level config into a channel URI with smaller terms.","solutions":["Set publication-window-length <= termLength >> 1","Increase term-length so that half of it exceeds the desired window","Remove the publication-window-length param to accept the driver default"],"exampleFix":"// before\n\"aeron:udp?endpoint=...:40456|term-length=1m|publication-window-length=2m\"\n// after\n\"aeron:udp?endpoint=...:40456|term-length=4m|publication-window-length=2m\"","handlingStrategy":"validation","validationCode":"if (publicationWindowLength > (termLength >> 1)) throw new IllegalArgumentException(\"window must be <= termLength/2\");","typeGuard":null,"tryCatchPattern":"try { pub = aeron.addPublication(uri, streamId); } catch (InvalidChannelException e) { log.error(\"window vs term-length conflict: {}\", e.getMessage()); }","preventionTips":["Choose window and term-length together from one tuning table","Watch size-unit suffixes (k/m) in URI params","Re-validate URIs after reducing term-length for latency tuning"],"tags":["aeron","uri","configuration"],"backgroundTag":"conflicting-config-options","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}