@frankbearguard/ignite-client-14550-fix
v1.0.0
Published
Unofficial drop-in runtime patch for [email protected] that fixes IGNITE-14550 ("Invalid response id" race under concurrent queries).
Maintainers
Readme
@frankbearguard/ignite-client-14550-fix
Unofficial drop-in runtime patch for
apache-ignite-client@1.0.0that fixes IGNITE-14550 — the "Invalid response id" race that disconnects the Node.js thin client under concurrent queries.
apache-ignite-client has had a single npm release (1.0.0, 2018) and the bug is still open/unresolved upstream. This is a tiny, dependency-free patch you can drop in without changing your Ignite client version.
The problem
Running more than a handful of queries per second against Ignite intermittently throws:
IgniteClientError: Invalid response id: 4122254909997320969and tears down the socket (subsequent calls then fail with "Ignite client is not in an appropriate state…").
Root cause: ClientSocket._processResponse is async and awaits the payload reader while still holding shared parser state (this._buffer / this._offset). Node does not await an async event listener before firing the next data event, so a second TCP frame re-enters _processResponse mid-await and corrupts the shared buffer → bogus request id → throw → disconnect.
The fix
The method is split into two phases:
- Synchronous framing — walk the buffer with no
await, copying each complete message into its own isolatedMessageBufferslice, leavingthis._buffer/this._offsetconsistent before any async work. - Asynchronous dispatch — hand those isolated slices to the original
_finalizeHandshake/_finalizeResponse.
Because all shared-state mutation is synchronous, concurrently re-entered calls can no longer corrupt each other. Sub-requests issued from a payload reader (e.g. OP_GET_BINARY_TYPE) keep working.
Install
npm install @frankbearguard/ignite-client-14550-fix
# [email protected] is a peer dependency (you already have it)Usage
require it once, before you create or use the Ignite client:
require('@frankbearguard/ignite-client-14550-fix'); // must come first
const IgniteClient = require('apache-ignite-client');
// ... use IgniteClient as usualThe patch mutates ClientSocket.prototype process-wide and is idempotent (safe to require from multiple modules). Set IGNITE_14550_VERBOSE=1 to log a one-line confirmation when it applies.
Compatibility
| | |
|---|---|
| Target | [email protected] (the only npm release) |
| Node.js | >= 8 |
| Ignite server | tested against Apache Ignite 2.16 |
The patch performs a structure check on load and throws a clear error if it is used against an unexpected library version/shape (rather than silently mis-patching).
Scope & known limitations
- Deliberately narrow: it fixes the concurrency race only.
- It preserves
1.0.0's behaviour of throwing on an unmatched request id (which disconnects). Ignite 2.14+ can push unsolicited topology/heartbeat frames; a protocol-1.2.0 client (1.0.0) does not negotiate those features, so this is very unlikely in practice. A fuller, source-level fix that also discards unsolicited frames (plus cursor/error fixes) lives in upstream PR apache/ignite-nodejs-thin-client#10.
Relation to upstream
- JIRA: IGNITE-14550 (Open / Blocker / Unassigned)
- Related open PRs (unmerged): #3 (2021), #10 (2026)
If upstream ever ships a release with the fix, prefer that and drop this patch.
License & disclaimer
Apache-2.0. This package is derived from Apache Ignite source — see NOTICE.
This is an unofficial community fix, provided as-is, and is not endorsed by or affiliated with the Apache Software Foundation. "Apache Ignite®" is a trademark of the ASF.
