Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/handlers/trackservers.q
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SERVERS:@[value;`.servers.SERVERS;([]procname:`symbol$();proctype:`symbol$();hpu

enabled:@[value;`enabled;1b] // whether server tracking is enabled
CONNECTIONS:@[value;`CONNECTIONS;`] // the list of connections to make at start up
DISCOVERYREGISTER:@[value;`DISCOVERYREGISTER;1b] // whether to register with the discovery service
CONNECTIONSFROMDISCOVERY:@[value;`CONNECTIONSFROMDISCOVERY;1b] // whether to get connection details from the discovery service (as opposed to the static file)
DISCOVERYREGISTER:@[value;`DISCOVERYREGISTER;DISCOVERYCONNECT] // whether to register with the discovery service
CONNECTIONSFROMDISCOVERY:@[value;`CONNECTIONSFROMDISCOVERY;DISCOVERYCONNECT] // whether to get connection details from the discovery service (as opposed to the static file)
Comment on lines +14 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave these as defaulting to 0b. DISCOVERYCONNECT is not defined in this file, so this enforces that that variable must be defined in config, which we don't want

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the assumption that config/settings/default.q would always be loaded in to every process before any other config, but if this is incorrect then I'll change to 0b

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly incorrect, but the reason we have all these @[value;...] lines is so that none of these values have to be set in config - obviously people can (& often should) change default configs etc., so just makes more sense to have sensible defaults in the code that doesn't depend on config

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah makes sense, cheers

SUBSCRIBETODISCOVERY:@[value;`SUBSCRIBETODISCOVERY;1b] // whether to subscribe to the discovery service for new processes becoming available
DISCOVERYRETRY:@[value;`DISCOVERYRETRY;0D00:05] // how often to retry the connection to the discovery service. If 0, no connection is made
TRACKNONTORQPROCESS:@[value;`TRACKNONTORQPROCESS;0b] // whether to track and register non torQ processes
Expand Down
37 changes: 19 additions & 18 deletions config/settings/default.q
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,25 @@ enabled:0b // prevent write access to clients if enabled

// Server connection details
\d .servers
enabled:1b // whether server tracking is enabled
CONNECTIONS:`rdb`hdb // list of connections to make at start up
DISCOVERYREGISTER:1b // whether to register with the discovery service
CONNECTIONSFROMDISCOVERY:1b // whether to get connection details from the discovery service (as opposed to the static file).
TRACKNONTORQPROCESS:1b // whether to track and register non torQ processes
NONTORQPROCESSFILE:hsym first .proc.getconfigfile["nontorqprocess.csv"] // non torQ processes file
SUBSCRIBETODISCOVERY:1b // whether to subscribe to the discovery service for new processes becoming available
DISCOVERYRETRY:0D00:05 // how often to retry the connection to the discovery service. If 0, no connection is made. This also dictates if the discovery service can connect it and cause it to re-register itself (val > 0)
HOPENTIMEOUT:2000 // new connection time out value in milliseconds
RETRY:0D00:05 // period on which to retry dead connections. If 0, no reconnection attempts
RETAIN:`long$0D00:30 // length of time to retain server records
AUTOCLEAN:0b // clean out old records when handling a close
DEBUG:1b // log messages when opening new connections
LOADPASSWORD:1b // load the external username:password from ${KDBCONFIG}/passwords
STARTUP:0b // whether to automatically make connections on startup
DISCOVERY:enlist` // list of discovery services to connect to (if not using process.csv)
SOCKETTYPE:enlist[`]!enlist ` // dict of proctype -> sockettype e.g. `hdb`rdb`tp!`tcps`tcp`unix
PASSWORDS:enlist[`]!enlist ` // dict of host:port!user:pass
enabled:1b // whether server tracking is enabled
CONNECTIONS:() // list of connections to make at start up
DISCOVERYCONNECT:$[`lim in key`.Q;$[0W=.Q.lim[][`conns];1b;0b];1b] // check for limit on process connections (relevant for KDB-X community edition)
DISCOVERYREGISTER:DISCOVERYCONNECT // whether to register with the discovery service
CONNECTIONSFROMDISCOVERY:DISCOVERYREGISTER // whether to get connection details from the discovery service (as opposed to the static file).
TRACKNONTORQPROCESS:1b // whether to track and register non torQ processes
NONTORQPROCESSFILE:hsym first .proc.getconfigfile["nontorqprocess.csv"] // non torQ processes file
SUBSCRIBETODISCOVERY:1b // whether to subscribe to the discovery service for new processes becoming available
DISCOVERYRETRY:0D00:05 // how often to retry the connection to the discovery service. If 0, no connection is made. This also dictates if the discovery service can connect it and cause it to re-register itself (val > 0)
HOPENTIMEOUT:2000 // new connection time out value in milliseconds
RETRY:0D00:05 // period on which to retry dead connections. If 0, no reconnection attempts
RETAIN:`long$0D00:30 // length of time to retain server records
AUTOCLEAN:0b // clean out old records when handling a close
DEBUG:1b // log messages when opening new connections
LOADPASSWORD:1b // load the external username:password from ${KDBCONFIG}/passwords
STARTUP:0b // whether to automatically make connections on startup
DISCOVERY:enlist` // list of discovery services to connect to (if not using process.csv)
SOCKETTYPE:enlist[`]!enlist ` // dict of proctype -> sockettype e.g. `hdb`rdb`tp!`tcps`tcp`unix
PASSWORDS:enlist[`]!enlist ` // dict of host:port!user:pass

// functions to ignore when called async - bypass all permission checking and logging
\d .zpsignore
Expand Down
2 changes: 1 addition & 1 deletion config/settings/segmentedchainedtickerplant.q
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ enabled:1b // switch on subscribercutoff

\d .servers
CONNECTIONS,:`segmentedtickerplant
CONNECTIONSFROMDISCOVERY:1b
CONNECTIONSFROMDISCOVERY:DISCOVERYCONNECT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change this? This won't change behaviour in case of community edition (it was already 0b), but will change behaviour in non-community edition, making it 1b

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it was 1b before, even though it looks like it was 0b in the PR discussion: https://github.com/DataIntellectTech/TorQ/blob/master/config/settings/segmentedchainedtickerplant.q#L40

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, github acting strange

in that case, this comment applies here too: DataIntellectTech/TorQ-Finance-Starter-Pack#122 (comment)

Loading