Commit Graph

22 Commits

Author SHA1 Message Date
ebf541c1fe fix: 调试执行移入子进程并加上资源限制
pg_logger 原来直接在 API 进程内跑用户代码,有三个问题:

- /debug 是 async def 却做同步的 CPU 密集跟踪,单个请求会堵死事件循环
- exec_script_str_local 传了 disable_security_checks=True,setrlimit 被跳过,
  MAX_EXECUTED_LINES 只能限制行事件数,挡不住 sum(range(10**9)) 这类单行重计算
- input_string_queue 和 sys.stdout 都是模块级全局,并发请求会互相干扰

改成在子进程里执行:子进程内设 CPU 5s / 内存 512MB(软硬限留差值,
让 SIGXCPU 先于 SIGKILL 到达以便区分原因),父进程再加 15s 墙钟超时兜住
time.sleep 这类不耗 CPU 的挂起。端点改同步 def 走线程池,异常统一转成
400 + 中文 detail。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QGZaLUWzGPEMTk6A5RShC
2026-09-07 04:45:49 -06:00
a4f4c9f7b9 fix: correct alphabetical ordering of sqlparse in requirements.txt
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 00:10:35 -06:00
7355610f37 feat: format SQL code via sqlparse in the /format endpoint 2026-07-05 00:07:20 -06:00
8ca04c2e17 fix 2026-06-14 07:18:53 -06:00
8d40a7b2f0 feat: add POST /format endpoint 2026-06-14 06:57:55 -06:00
b0a7ac9503 feat: add formatter module wrapping ruff and clang-format 2026-06-14 06:54:28 -06:00
56662a0520 fix: correct alphabetical ordering of ruff in requirements.txt 2026-06-14 06:52:11 -06:00
01db259f91 build: add ruff and pytest dependencies, install clang-format in image
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 06:51:00 -06:00
55a42597bb docs: add implementation plan for code formatting feature 2026-06-14 06:43:52 -06:00
799216b184 docs: add design spec for code formatting feature 2026-06-14 06:40:04 -06:00
1b3d893abd fix 2026-06-04 21:24:05 -06:00
6533df2173 update 2026-05-19 08:04:15 -06:00
c2549cf3cc fix aiosqlite 2025-12-20 22:38:20 +08:00
2f9f7b8f85 update 2025-12-20 22:24:18 +08:00
51d071a3a0 fix 2025-10-27 18:56:54 +08:00
59171a1254 update 2025-10-22 02:33:18 +08:00
4523b72333 update 2025-10-21 21:51:42 +08:00
2c35a16224 fix 2025-10-21 21:43:18 +08:00
924a6378ae update 2025-10-21 21:38:01 +08:00
2f6936ce2a update 2025-10-21 21:35:53 +08:00
a570733966 update 2025-10-21 21:32:25 +08:00
4e62afc40e first commit 2025-10-21 21:26:56 +08:00