Skip to content

Fix .Q.lim[] dict access for KDB-X Community edition connection limit…#738

Open
fd98279 wants to merge 1 commit intoDataIntellectTech:masterfrom
fd98279:kx-community-compat
Open

Fix .Q.lim[] dict access for KDB-X Community edition connection limit…#738
fd98279 wants to merge 1 commit intoDataIntellectTech:masterfrom
fd98279:kx-community-compat

Conversation

@fd98279
Copy link
Copy Markdown

@fd98279 fd98279 commented May 5, 2026

.Q.lim[] returns a dict curlim!N N in KDB-X, not a scalar. The condition 0W=.Q.lim[][conns]` compared 0W against the whole dict, which always evaluates false causing discovery to be enabled even under connection limits.

q).Q.lim[]
| cur lim
----- | ---------
cores | 10 0W
threads| 0 4
mem | 64 16384
conns | 1 8

q).Q.lim[][conns][lim]
8
q)0W=.Q.lim[][conns][lim]
0b

Fix: use x[conns][lim] to extract the scalar limit value so the
comparison works correctly. With lim=8: 0W=8 → 0b → discovery disabled.

Affects:

  • config/settings/default.q (DISCOVERYCONNECT)
  • config/settings/segmentedchainedtickerplant.q (CONNECTIONSFROMDISCOVERY)

… check

.Q.lim[] returns a dict `cur`lim!N N in KDB-X, not a scalar. The condition
`0W=.Q.lim[][`conns]` compared 0W against the whole dict, which always
evaluates false causing discovery to be enabled even under connection limits.

Fix: use `x[`conns][`lim]` to extract the scalar limit value so the
comparison works correctly. With lim=8: `0W=8` → 0b → discovery disabled.

Affects:
- config/settings/default.q (DISCOVERYCONNECT)
- config/settings/segmentedchainedtickerplant.q (CONNECTIONSFROMDISCOVERY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant