Skip to content

偶发JSONDecodeError #63

@Matt-Dong123

Description

@Matt-Dong123

如题,判题机运行一段时间就会偶发JSONDecodeError的情况,好像是沙箱里面返回空值,各位大神有遇到类似的问题嘛或者有好的解决办法嘛

Traceback (most recent call last):
  File "/app/server.py", line 288, in server
    ret = {"err": None, "data": getattr(JudgeServer, path)(**data)}
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/server.py", line 164, in judge
    exe_path = Compiler().compile(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/compiler.py", line 27, in compile
    result = judger.run(
             ^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/judger/__init__.py", line 85, in run
    return json.loads(out.decode("utf-8"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/decoder.py", line 338, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/decoder.py", line 356, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions