You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org> on 2026/10/15 18:53:27 UTC

Re: [PR] fix(websocket): support Sentinel and full TLS options for Redis/Valkey [superset]

codeant-ai-for-open-source[bot] commented on code in PR #45355:
URL: https://github.com/apache/superset/pull/45355#discussion_r4287026889


##########
superset-websocket/src/config.ts:
##########
@@ -134,6 +164,41 @@ const toStringArray = (s: string) =>
     .map(entry => entry.trim())
     .filter(entry => entry.length > 0);
 
+// Parse "host:port,host:port" (IPv6 hosts as "[::1]:26379"). A missing port
+// defaults to the Sentinel port; an unparseable entry is skipped with a warning.
+function toSentinelNodes(s: string): SentinelNode[] {
+  return toStringArray(s).flatMap(entry => {
+    const sep = entry.lastIndexOf(':');
+    const hasPort = sep > 0 && !entry.endsWith(']');
+    const host = (hasPort ? entry.slice(0, sep) : entry).replace(
+      /^\[|\]$/g,
+      '',
+    );
+    const port = hasPort ? Number(entry.slice(sep + 1)) : 26379;
+    if (!host || !Number.isInteger(port) || port <= 0) {

Review Comment:
   **Suggestion:** Ports above 65535 pass this check and reach ioredis, where TCP rejects them, leaving that Sentinel node unable to connect despite being accepted as valid.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Logic error`
   
   [![Use CodeAnt Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=0186b9990ac14345a0280014670beaee&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=0186b9990ac14345a0280014670beaee&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-websocket/src/config.ts
   **Line:** 178:178
   **Comment:**
   	*Logic Error: Ports above 65535 pass this check and reach ioredis, where TCP rejects them, leaving that Sentinel node unable to connect despite being accepted as valid.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45355&comment_hash=86813cd634da16646cd288695cb653585dd1a08af3cbf8be5879585099b1ed21&reaction=like'>๐Ÿ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45355&comment_hash=86813cd634da16646cd288695cb653585dd1a08af3cbf8be5879585099b1ed21&reaction=dislike'>๐Ÿ‘Ž</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org