Skip to content

Failed Start Stream Request leaves server in ERROR state #67

@eliteprox

Description

@eliteprox

An issue was introduced in PR 36 #36 which causes the pipeline state to revert to ERROR when a start stream request fails due to a stream already running. pyrickle

INFO:__main__:🔄 Model loading started...
INFO:__main__:Simulating model load for 15.0s...
INFO:pytrickle.server:Server started on 0.0.0.0:8000
INFO:aiohttp.access:172.18.0.8 [24/Nov/2025:16:48:36 -0500] "POST /stream/stop HTTP/1.1" 400 226 "-" "Go-http-client/1.1"
INFO:__main__:✅ Model loading complete in 15.00s
INFO:pytrickle.stream_processor:StreamProcessor 'model-loading-demo' model loaded successfully
INFO:pytrickle.stream_processor:Model loaded via parameter update for 'model-loading-demo'
ERROR:pytrickle.server:Error in start stream handler: Connection lost
ERROR:pytrickle.state:Stream state: ERROR - Stream start failed: Connection lost
ERROR:pytrickle.state:Error occurred from state IDLE, call stack:
ERROR:pytrickle.state:['  File "/home/elite/repos/pytrickle/.conda/lib/python3.11/site-packages/aiohttp/web_app.py", line 569, in _handle\n    return await handler(request)\n', '  File "/home/elite/repos/pytrickle/pytrickle/server.py", line 480, in _handle_start_stream\n    self.state.set_error(f"Stream start failed: {str(e)}")\n']
ERROR:pytrickle.state:State transition: IDLE → ERROR
INFO:aiohttp.access:172.18.0.8 [24/Nov/2025:16:48:38 -0500] "POST /stream/start HTTP/1.1" 400 0 "-" "Go-http-client/1.1"
WARNING:pytrickle.server:Stream start rejected - pipeline not ready yet
INFO:aiohttp.access:172.18.0.8 [24/Nov/2025:16:48:47 -0500] "POST /stream/start HTTP/1.1" 503 0 "-" "Go-http-client/1.1"

Prevents new stream from starting until server is restarted

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