mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5175] [Engine] Windows: the image encoder's log handle overwrites the engine's lines in the shared server log #3080
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3080
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Cryonic7 on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5175
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
On Windows, with a
"log"file and a"vision"section in the config, the server writes three components' output into that one file through separate handles:serve/server.py:1121);serve/server.py:9754);serve/server.py:9867).Each handle is passed to a child process as its stderr. On Windows each handle keeps its own file position, and a child process writes at that position. Python's
"a"mode only moves to the end of the file for writes made by the Python process itself, not for writes a child makes through the inherited handle.So an image encoder started minutes after the engine (an elastic encoder starts on the first picture) writes at the position the log had when the server started. That is over the engine's start-up lines. We saw the session's first lines (
engine started: ..., the cache sizing lines) overwritten by the encoder's output, more with each picture, and the engine's next lines can land over the encoder's in turn.Expected: every component's lines kept, in the order they were written.
Smallest steps or command that reproduce it
The mechanism, without Strata (Windows, Python 3):
In Strata: start a server on Windows with
"log"and an elastic"vision"section, let the engine come up, send one request with a picture, then read the first lines of the log.Reproduction status
Reproduced locally
Strata version
Strata 0.2.10 · engine 0.1.56 has the same three handles at the lines above (read, not run live). We saw it happen on our lab server built from 0.1.44, which has the same code at these sites, and the script above shows the mechanism.
Graphics card, memory and system
RTX 4090 24 GB · 64 GB RAM · Windows 11 Pro
Model, size and settings
Swift 1.5 IQ3_S · 262K context · pictures on (GPU encoder,
"elastic": true)A fix that works here
Open every log handle a child process writes to with
FILE_APPEND_DATAand withoutFILE_WRITE_DATA. Windows then puts each write at the end of the file, whoever makes it. POSIX already does this withO_APPEND, so nothing changes there.At each of the three sites, use
open(log, "a", encoding="utf-8", opener=log_opener).Passed:
Not run:
O_APPEND).