HTTP: shared_set returns null for a write it refused, the same as for a write it made
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read the shared_set and shared_incr implementations, their tests, and docs/BUILTINS.md; the issue does not name source or test paths. Start by tracing how each builtin enforces the byte cap and handles invalid values, then check how raised errors reach routes. Done when the listed cases raise as specified, preserve existing values, produce a 500 when uncaught, and the documentation describes the errors.
由索引模型根据 Issue 内容生成。
描述
Found beside #2380. Run on a make server-db build of 68dbb67e (phase2-numbers). The same code is on main; it was not run there.
What happens
shared_set returns null when it has stored the value. It also returns null when the write would pass the store's byte cap (EIGS_HTTP_SHARED_MAX_BYTES, 64 MiB by default) and nothing was stored:
big is ""
i is 0
loop while i < 300:
big is big + "x"
i is i + 1
a is shared_set of ["small", "ok"]
b is shared_set of ["big", big]
print of (json_encode of [a, shared_has of "small", b, shared_has of "big"])
With EIGS_HTTP_SHARED_MAX_BYTES=200 in the environment:
[null,true,null,false]
docs/BUILTINS.md says it ("Returns null if over byte cap"), so this is the contract as written and not a slip. It is still a call that did not do what was asked and told the caller nothing that differs from success (PRINCIPLES §2). The only way to find out is to read the key back. A server whose store is full goes on answering while every write is dropped.
shared_incr does the same in two places: over the cap, and on a key whose value is not a number (documented too). Both return null and change nothing, while its int64 overflow raises value.
Recommended
A write that is refused raises and changes nothing: value for the cap, with the builtin's name, the cap and the bytes the store would have held, as the int64 overflow of shared_incr raises today; and shared_incr on a value that is not a number raises too. Which kind that second raise has is decided here before the build.
Done when
- The program above, with the cap at 200, raises
valueat the secondshared_set, and after the raisesmallis still there andbigis not. - A
shared_setthat replaces a value and would pass the cap raises, and the old value stays. -
shared_incrover the cap raisesvalueand changes nothing.shared_incron a key that holds a string raises the kind decided here, and the string stays. - A route that catches none of these answers
500, as a route that raises does today. -
docs/BUILTINS.md: the rows ofshared_setandshared_incrand the paragraph on the cap say what is raised. - Shown once in the pull request: with the fix taken out, each row above is red.
— Claude DevBox
- 主要语言
- C
- 星标
- 3
- 派生
- 7
- 平均合并
- 3 小时 28 分钟
- 30 天内合并 PR
- 270
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
InauguralSystems/EigenScript 的其他 Issue
-
area:gates kind:gate-defect
难度 2/5 1-3 小时 新手友好度 83/100
InauguralSystems/EigenScript#2476 ·
维护者通常 1 天内回复
-
area:gates needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
InauguralSystems/EigenScript#2462 · 1 条评论 ·
维护者通常 1 天内回复
-
The hosted-RNG check refuses a clean tree that has a tracked file with a double quote in its name未关闭area:gates kind:gate-defect needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
InauguralSystems/EigenScript#2461 · 1 条评论 ·
维护者通常 1 天内回复
-
area:gates kind:gate-defect needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
InauguralSystems/EigenScript#2458 · 1 条评论 ·
维护者通常 1 天内回复
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a word未关闭area:http kind:silent-wrong
难度 2/5 1-3 小时 新手友好度 72/100
InauguralSystems/EigenScript#2394 · 1 条评论 ·
维护者通常 1 天内回复
查看 InauguralSystems/EigenScript 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
flipperdevices/flipperzero-firmware#4520 ·
维护者通常 1 天内回复
-
area/build-framework kind/enhancement priority/low
难度 2/5 1-3 小时 新手友好度 77/100
yugabyte/yugabyte-db#38826 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
meshcore-dev/MeshCore#3891 · 1 条评论 ·
维护者通常 1 天内回复
-
bug grammar sev-3
难度 2/5 1-3 小时 新手友好度 76/100
-
status: needs-triage type: bug
难度 2/5 1-3 小时 新手友好度 75/100