`fast_queue=True` is silently ignored — the ZMQ transport is never enabled (and would be misconfigured if it were)

Aperta
#751 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@iammayankg ci sta già lavorando.

Dal 17/10/2026.

  • #752 di @betacatsling — chiusa senza merge
  • #790 di @iammayankg — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia da src/litserve/server.py e src/litserve/transport/factory.py, poi esamina TransportConfig e ZMQTransport per verificare il tipo di trasporto configurato e l’ordine degli indirizzi. Esegui le riproduzioni dell’issue con LitServer e create_transport_from_config; il lavoro è completo quando fast_queue=True seleziona zmq e il trasporto prodotto conserva gli indirizzi backend e frontend configurati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug description

LitServer(..., fast_queue=True) is documented to switch the request/response
transport to ZeroMQ for high-throughput serving. It currently has no effect:

  1. LitServer.__init__ builds the transport configuration with the wrong
    keyword name:

    # src/litserve/server.py
    self.transport_config = TransportConfig(transport_config="zmq" if self.use_zmq else "mp")
    

    TransportConfig has a field named transport_type, not
    transport_config. Pydantic ignores the unknown keyword, so
    transport_type always stays at its default "mp" — fast_queue=True
    silently falls back to the multiprocessing-queue transport.

  2. Even when transport_type="zmq" is set directly, the ZMQ transport is
    wired with swapped addresses:

    # src/litserve/transport/factory.py
    return ZMQTransport(config.frontend_address, config.backend_address)
    

    ZMQTransport.__init__(self, backend_address, frontend_address) receives
    the frontend address as backend_address and vice versa. Workers then
    publish responses to the broker's frontend (XPUB) socket while consumers
    subscribe on the backend (XSUB) socket, so responses are never delivered
    and every request hangs until it times out.

Reproduction

from litserve.server import LitServer
from litserve.test_examples import SimpleLitAPI  # or any LitAPI

server = LitServer(SimpleLitAPI(), fast_queue=True)
print(server.transport_config.transport_type)  # expected: "zmq", actual: "mp"

And the address swap can be shown with:

from litserve.transport.factory import TransportConfig, create_transport_from_config

config = TransportConfig(transport_type="zmq", num_consumers=1)
transport = create_transport_from_config(config)
assert transport.backend_address == config.backend_address  # fails: swapped

Expected behavior

  • fast_queue=True should produce transport_config.transport_type == "zmq".
  • The produced ZMQTransport should connect producers to the broker backend
    and consumers to the broker frontend, so responses actually reach the
    requester.

Environment

  • LitServe: current main (commit 1624847)
  • Python 3.12, Linux
Lingua principale
Python
Stelle
4k
Fork
339
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Lightning-AI/LitServe

Tutte le issue di Lightning-AI/LitServe

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.