Skip to content

[Bug]: Duplicate request_id breaks the engine #10583

@tjohnson31415

Description

@tjohnson31415

Your current environment

The environment is not relevant.

Model Input Dumps

No response

🐛 Describe the bug

The request_id field used in the LLM Engine is assumed to be unique, but it is a parameter that can be set by the caller. After #9550, the request_id is configurable even by a caller to the OpenAI Server.

I originally encountered this issue while investigating the cause of negative metrics in #10430. I found that sending two requests concurrently with the same request id can cause the negative metric error. Example bash using curl:

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
        "model": "meta-llama/Llama-3.2-3B-Instruct",
        "request_id": "id",
        "messages": [{"role": "user", "content": "Tell me a long story:"}],
        "max_tokens": 1024,
        "min_tokens": 1024,
        "temperature": 0
      }' &

sleep 0.5

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
        "model": "meta-llama/Llama-3.2-3B-Instruct",
        "request_id": "id",
        "messages": [{"role": "user", "content": "Tell me a long story:"}],
        "max_tokens": 1024,
        "min_tokens": 1024,
        "temperature": 0
      }' &

The fix in #10430 properly prevents the crash, but only one request gets a response and the other connection hangs open.

Other users have reported other bad behavior that looks to be caused by duplicate request_ids:

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions