Skip to content

Commit

Permalink
fix: increase the limit for query length from 5k to 128k
Browse files Browse the repository at this point in the history
  • Loading branch information
slim-bean authored and xperimental committed Jun 14, 2024
1 parent 85b0b77 commit 62a3b3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/logql/syntax/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ var parserPool = sync.Pool{
},
}

const maxInputSize = 5120
// (E.Welch) We originally added this limit from fuzz testing and realizing there should be some maximum limit to an allowed query size.
// The original limit was 5120 based on some internet searching and a best estimate of what a reasonable limit would be.
// We have seen use cases with queries containing a lot of filter expressions or long expanded variable names where this limit was too small.
// Apparently the spec does not specify a limit, and more internet searching suggests almost all browsers will handle 100k+ length urls without issue
// Some limit here still seems prudent however, so the new limit is now 128k.
// Also note this is used to allocate the buffer for reading the query string, so there is some memory cost to making this larger.
const maxInputSize = 131072

func init() {
// Improve the error messages coming out of yacc.
Expand Down

0 comments on commit 62a3b3a

Please sign in to comment.