Skip to content

Make sure sss_failover_transaction_connected_recv() never - #9683

Open
alexey-tikhonov wants to merge 1 commit into
SSSD:failoverfrom
alexey-tikhonov:failover-no-null
Open

alexey-tikhonov wants to merge 1 commit into
SSSD:failoverfrom
alexey-tikhonov:failover-no-null

Conversation

@alexey-tikhonov

Copy link
Copy Markdown
Member

returns NULL.

Implementation assisted-by: Claude Code (Opus 4.8)

returns NULL.

Implementation assisted-by: Claude Code (Opus 4.8)
@alexey-tikhonov

Copy link
Copy Markdown
Member Author

Not sure if CI is broken in this branch?

@pbrezina pbrezina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just commenting now.

Will do proper review later as I'm not entirely sure if sss_failover_set_connection should be used to set fctx->conn to NULL.

* caller's lifetime and is guaranteed to be non-NULL. Callers therefore never
* need to check the result for NULL.
*
* @mem_ctx is intentionally unused: the connection is owned by the connected

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why keep mem_ctx instead of ditching it?

@pbrezina

Copy link
Copy Markdown
Member
        +++ ci-select-tests --repo SSSD/sssd
        Fetching diff for pull request SSSD/sssd#9683...
        curl: (22) The requested URL returned error: 503
        curl: (22) The requested URL returned error: 503
        curl: (22) The requested URL returned error: 503
        curl: (22) The requested URL returned error: 503
        curl: (22) The requested URL returned error: 503
        curl: (22) The requested URL returned error: 503
        curl: (22) The requested URL returned error: 503

not sure why

@pbrezina

Copy link
Copy Markdown
Member

/packit test

@alexey-tikhonov

Copy link
Copy Markdown
Member Author

as I'm not entirely sure if sss_failover_set_connection should be used to set fctx->conn to NULL.

I don't know how to approach this better, but during review of #8751 I saw repeated pattern that checks (conn == NULL) and errors request. I'd like to get rid of this copy&paste.
IIUC, the only case when returned conn could be NULL is OOM. I can't imagine where user code would need to handle this differently so why not to fail req inside failover engine code?

@pbrezina pbrezina self-assigned this Nov 26, 2026
@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants