Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbus: move to single sbus server #6971

Closed
wants to merge 12 commits into from
Closed

sbus: move to single sbus server #6971

wants to merge 12 commits into from

Conversation

pbrezina
Copy link
Member

@pbrezina pbrezina commented Oct 4, 2023

This is a continuation of #6257.
I rebased it and added descriptions to commit messages.

I need to verify functionality since the pull request was opened
for a long time and fix the issue that is currently just mitigated
(probably incorrectly). Therefore this is a draft so far.

@pbrezina pbrezina marked this pull request as draft October 4, 2023 11:32
@pbrezina pbrezina mentioned this pull request Oct 4, 2023
@pbrezina pbrezina force-pushed the sbus branch 5 times, most recently from b71b567 to ddfa69a Compare October 6, 2023 11:26
@pbrezina pbrezina marked this pull request as ready for review October 6, 2023 14:22
@pbrezina
Copy link
Member Author

pbrezina commented Oct 6, 2023

This is ready for review now.

@pbrezina pbrezina added the no-backport This should go to target branch only. label Oct 6, 2023
@aplopez aplopez self-assigned this Oct 9, 2023
Copy link
Contributor

@aplopez aplopez left a comment

Choose a reason for hiding this comment

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

What a job!
I hope I didn't miss anything, but it looks good to me.

@alexey-tikhonov
Copy link
Member

alexey-tikhonov commented Oct 24, 2023

Mistypes in commit messages: availble, individuall, they were changed (chained).

@alexey-tikhonov
Copy link
Member

alexey-tikhonov commented Oct 24, 2023

In the commit sbus: add destination to request key, all "*keygens*" files are "Generated by sbus code generator".
What change triggers this re-generation?

Even in the unlikely case when multiple of these methods where
called in parallel, we must treat them as separate calls and
handle them individually to avoid situations like:

- SetInconsistent
- SetActive
- SetInconsistent

Here, if chained, it translates to SetInconsistent -> SetActive, which
is wrong. Therefore we can not chain these signals.
This allows us to connect to the D-Bus server sooner and remove code
duplication in responders and backend.

Now we can connect to the bus when we are ready and register the process
in the monitor when the process is fully initialized.
We used asynchronous connection because we were also creating
a dbus server. Now we do not create the server anymore so we
can switch back to a blocking call and simplify the code.

Blocking call is alright at this moment, since we can not serve
any requests anyway and the backend is not yet fully initialized.
Whole initialization was postponed until this call is finished
in non-blocking mode as well.
Switching to single dbus server allows us to remove this code since
all clients can now be contacted via their own unique dbus name.

This code is no longer used since the switch.
So we are able to match the logged messages with particular sender.
Asynchronous connection to D-Bus is only needed when creating a server
and that is done by `sbus_server_create_and_connect_send`. Non-blocking
connection does not make sense on other places in SSSD because we use
D-Bus for IPC therefore if D-Bus connection is not functional, our
process can not function as well and therefore the blocking connection
actually makes more sense.
@pbrezina
Copy link
Member Author

Everything should be fixed and addressed now.

@pbrezina
Copy link
Member Author

setactive/inconsistent is also build only for files provider.

sbus codegen does not support conditional code though and its probably not worth spending time on it.

@alexey-tikhonov
Copy link
Member

setactive/inconsistent is also build only for files provider.

Imo, DOM_INCONSISTENT itself (and consequently all usages) should be under ifdef as well.

These signals are only used by files provider, they are not completely
reliable because they are prone to race conditions and should not
really be used elsewhere.
@pbrezina
Copy link
Member Author

setactive/inconsistent is also build only for files provider.

Imo, DOM_INCONSISTENT itself (and consequently all usages) should be under ifdef as well.

Done.

@alexey-tikhonov
Copy link
Member

@aplopez, please take a look at the latest version.

@alexey-tikhonov
Copy link
Member

Thank you, ACK.

@aplopez
Copy link
Contributor

aplopez commented Oct 31, 2023

ACK. Thanks.

@pbrezina pbrezina added the Ready to push Ready to push label Nov 1, 2023
@pbrezina
Copy link
Member Author

pbrezina commented Nov 1, 2023

Pushed PR: #6971

  • master
    • 9ece4e1 - dp: build dp_sbus_domain_active/inconsistent only with files provider
    • 10c1942 - sbus: make sbus_connect_private_send static
    • 174fb9e - sbus: log sender of received message
    • 9a47e2b - dp: remove client registration code
    • 8b47a9a - backend: connect to private dbus in a blocking way
    • 529af40 - sss_iface: split connection to dbus server and service registration
    • d9b2b8e - sbus: disable chaining for SetActive and SetInconsistent
    • ab486cb - sbus: convert calls in dp_resp_client.c into signals
    • a25b16e - sbus: correctly handle reply on signal chaining
    • 9f8551a - sbus: centralize communication to a single dbus server
    • b9c1d7d - sbus: add destination to request key
    • 83eec36 - sbus: store dbus connection name in domain.conn_name

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. Pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants