Skip to content

Commit

Permalink
Increase recursion limit in compiler worker processes (#8379)
Browse files Browse the repository at this point in the history
I've been threatening to do this for a while and it is finally time, I
think. Compiling the (complex!) query for `DESCRIBE INSTANCE CONFIG AS
DDL` as part of `dump --all` has been failing.
  • Loading branch information
msullivan authored Feb 24, 2025
1 parent 7f623b3 commit 2e259ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion edb/edgeql/compiler/config_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def compile_describe_config(
ctx.env.schema, scope, ctx.env.options.testmode)
config_ast = qlparser.parse_fragment(config_edgeql)

return dispatch.compile(config_ast, ctx=ctx)
with ctx.new() as subctx:
subctx.allow_factoring()
return dispatch.compile(config_ast, ctx=subctx)


def _describe_config(
Expand Down
3 changes: 3 additions & 0 deletions edb/server/compiler_pool/worker_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import os
import pickle
import signal
import sys
import time
import traceback

Expand Down Expand Up @@ -115,6 +116,8 @@ def main(get_handler):
parser.add_argument("--version-serial", type=int)
args = parser.parse_args()

sys.setrecursionlimit(2000)

ql_parser.preload_spec()
gc.freeze()

Expand Down
7 changes: 7 additions & 0 deletions tests/test_edgeql_userddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,13 @@ async def test_edgeql_userddl_all_extensions_01(self):
COMMIT MIGRATION;
""")

await self.con.query("""
describe current database config as ddl
""")
await self.con.query("""
describe instance config as ddl
""")

await self.con.execute(f"""
START MIGRATION TO {{
{ext_commands}
Expand Down

0 comments on commit 2e259ca

Please sign in to comment.