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

[3007.x] transports: fix and normalize PublishServer method signatures #66751

Open
wants to merge 13 commits into
base: 3007.x
Choose a base branch
from

Conversation

Sxderp
Copy link

@Sxderp Sxderp commented Jul 26, 2024

the arguments to publish, specifically io_loop, needs to be consistant across the different transports. This argument was not consistant and caused exceptions.

@Sxderp Sxderp requested a review from a team as a code owner July 26, 2024 18:19
Copy link

welcome bot commented Jul 26, 2024

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title zeromq: fix io_loop variable name in publish function [3007.x] zeromq: fix io_loop variable name in publish function Jul 26, 2024
@dmurphy18 dmurphy18 requested a review from dwoz July 26, 2024 19:09
@Sxderp
Copy link
Author

Sxderp commented Aug 14, 2024

I guess I never gave a full rundown on why this is needed.

The master creates a publish server. The factory method creates a MasterPubServerChannel with the chosen transport using ipc_publish_server, we're going to come back to that function in a moment.

In the pre_fork we call MasterPubServerChannel._publish_domain, which calls the publisher function on the transport. If the arguments are not correct then the function call will fail.

Going back to ipc_publish_server (and ipc_publish_client right next to it). There is an arbitrary restriction on using TCP only for these functions. I'm willing to bet that's because /for some reason/ (cough) zeromq was not working and the solution was to just use TCP instead

After my patch I was able to remove the TCP restriction and everything worked.

I have also added a test for required arguments. Perhaps it may make more sense with abstract classes? I'm not really sure. I'm also not 100% on what folder / file should be modified for the tests.

@Sxderp
Copy link
Author

Sxderp commented Aug 16, 2024

@dwoz I think this is fully ready. The CI is not running "core tests" so my test isn't actually executed. I'm not sure if there's something I need to do for that?

Also perhaps it may make sense to make the test more dynamic. Create and check a "Base" transport and ensure all arguments on that one are present on the child classes. If is that is the best route I can update. Maybe ABC can do that.

@Sxderp Sxderp changed the title [3007.x] zeromq: fix io_loop variable name in publish function [3007.x] transports: fix and normalize PublishServer method signatures Aug 28, 2024
@Sxderp Sxderp force-pushed the 3007.x-fix-zeromq-publisher branch from 7853236 to 579f86b Compare August 28, 2024 14:29
@Sxderp
Copy link
Author

Sxderp commented Aug 28, 2024

I have rebased onto 3007.x.

I have also extended the PR to include the other methods of PublishServer.

This will partially fix #66577 (follows are required to completely fix that one).

@dwoz
@dmurphy18

A followup PR should probably be made for PublishClient..

@Sxderp
Copy link
Author

Sxderp commented Sep 4, 2024

I think the write callback in transport.tcp is a holderver from IPCServer. I could not trace any code that actually used it. Local tests seem to agree.

@Sxderp
Copy link
Author

Sxderp commented Sep 13, 2024

@dmurphy18 requesting Workflows get ran again.

twangboy
twangboy previously approved these changes Sep 17, 2024
@dwoz dwoz force-pushed the 3007.x-fix-zeromq-publisher branch from 5566026 to ca322bd Compare October 24, 2024 01:31
pull_path=None,
pull_path_perms=0o600,
pub_path_perms=0o600,
ssl=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

ssl is not a valid option for all transports.

Copy link
Author

@Sxderp Sxderp Oct 24, 2024

Choose a reason for hiding this comment

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

Then it should be ignored by that transport. We already have issues with trying to pass the 'ssl' config when a transport does not support it. Do you expect the factory methods to know which transports do and do not support SSL and not pass it along? I think that defeats the purpose of the factory methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants