| Summary: | Headless mode not flushing CSV logger | ||
|---|---|---|---|
| Product: | [Technology] STEM | Reporter: | Matthew Davis <mattadav> |
| Component: | Simulation | Assignee: | Matthew Davis <mattadav> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | 1.2.0 | ||
| Hardware: | All | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Matthew Davis
Assigning to myself Problem identified. STEM uses a 10 MB write buffer on the loggers, as in many situations the CSV logger is out biggest bottleneck. There is no forced flushes while a simulation runs, it only flushes when the buffer fills up (which happens in 10 MB blocks). The problem with headless vs. GUI is simple. The two modes use different log wrappers that listen to simulation events. The GUI mode flushes the buffers on simulation pause and simulation stop. Headless mode only flushes (and closes the writer) on simulation stop. When a simulation completes its sequence, it enters into the PAUSED state. In GUI, this is fine, as it flushes the output then. For headless mode, it's not fine, because Java exits immediately after all jobs finish and never sends a STOP event. So, there are two bugs here: 1. Headless mode needs to send a STOP event to all simulations when they complete (which is OK, because they will never be used again for that instance). 2. The CustomCSVLogger (which headless mode uses) should flush the buffers on PAUSE. A third bug deals more generally with the headless mode, as there's no way to STOP a simulation. If you forcefully exit (control-c or kill) the JVM before a simulation finishes (which is possible on unbounded sims), there is potential (likely) data loss in the logs. Will examine this one more in depth. Fix committed to trunk at revision 1694. Merged to 1.2.0 branch at 1695. |