GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — Add Server.readlines_to_eof_timed for bulk trace-stream drain (#70) by fdcastel · Pull Request #71 · FirebirdSQL/python3-driver Conversation
Member
Resolves #70. WhatAdds Why
Concrete numbers from a matched-workload comparison (Firebird 5.0.3 on Windows; HammerDB TPC-C 200-call transaction mix against a pre-loaded 1-warehouse schema; identical trace.conf for both readers):
Same Python process, same Design choices
TestsTwo new integration tests in
I have not added a unit test that mocks the services connection because the existing tests are all integration-style against a live Firebird; happy to add mock-driven tests if the project prefers that direction. Compatibility
NotesSection heading in CHANGELOG.md added as Happy to iterate on naming (
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…rdSQL#70) `readline_timed` requests one line per services-API round-trip (`isc_info_svc_line`). Under sustained trace-stream throughput the per-call overhead caps a Python consumer at roughly 480 trace events/sec, while Firebird's own `fbtracemgr` reaches roughly 3000 trace events/sec because it uses `isc_info_svc_to_eof` (drain many lines per round-trip). The slow-drain path causes server-side trace buffer overruns and event loss — invisible to the client. This commit adds `readlines_to_eof_timed(timeout)` as a parallel method, mirroring fbtracemgr's request shape: - Sends `bytes([SrvInfoCode.TO_EOF])` as the request item. - Inspects the trailing indicator after the sized-string payload: isc_info_end (1) -> end of service, return None isc_info_svc_timeout (64) -> transient, return TIMEOUT isc_info_data_not_ready (4) -> transient, return data or TIMEOUT isc_info_truncated (2) -> more data coming, return data This explicitly distinguishes "service finished" from "no data right now". `readline_timed` only checks for `isc_info_svc_timeout` and treats every other empty payload as `None` (EOF), which prematurely terminates long-running consumers on transient idle rounds. - Returns the multi-line chunk verbatim; callers split with `.splitlines(keepends=True)`. `readline_timed` is left unchanged because `Server.readline`, stdin/STDOUT handlers, and any third-party callers depend on its one-line semantics. The new method is opt-in for consumers that need fbtracemgr-equivalent throughput. Tests: - `test_readlines_to_eof_timed_drain` — runs `database.get_statistics` twice (once via `readlines()`, once via the new method) and asserts identical normalised output, confirming the bulk path captures the full service response. - `test_readlines_to_eof_timed_returns_timeout_when_idle` — starts a trace session against an idle database; the very first read MUST return `TIMEOUT`, not `None`. Pins the "transient idle round != EOF" contract that the bug fix depends on.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. readline_timed drops trace stream events under load (uses isc_info_svc_line per-call instead of isc_info_svc_to_eof bulk drain)Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||||||||
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |