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

PortManager: start at port 29100 #3975

Merged
merged 3 commits into from
Oct 2, 2024
Merged

PortManager: start at port 29100 #3975

merged 3 commits into from
Oct 2, 2024

Conversation

brong
Copy link
Member

@brong brong commented Mar 15, 2022

This is higher and less likely to clash with other things

@brong brong requested a review from rsto March 15, 2022 13:44
@rsto
Copy link
Member

rsto commented Mar 15, 2022

I'm going to check this on my VM in a bit, but it will take a while.

@ksmurchison
Copy link
Contributor

We should also change the comment on the default value for base_port in cassandane.ini.example

@rsto
Copy link
Member

rsto commented Mar 15, 2022

Tests passed. Way better than it was before.

Copy link
Member

@rsto rsto left a comment

Choose a reason for hiding this comment

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

LGTM

@ksmurchison
Copy link
Contributor

Also works on my box

Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

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

Tested, works fine.

Agreed with Ken's comment though: please update the other 9100s too... ack 9100 finds these:

cassandane/cassandane.ini.example
74:##base_port = 9100

cassandane/genmail3.pl
66:        port => 9100,

cassandane/imap-append.pl
59:        port => 9100,

The latter two look like utility scripts which are assuming the default is 9100, but that assumption will no longer hold, and they'll break if used. I don't think we use them, but we can save our future selves a few minutes of confusion if we ever do, by keeping their assumptions updated.

ack '\b91\d\d\b' additionally finds these ones:

cassandane/Cassandane/Test/MessageStoreFactory.pm
94:    $ms = Cassandane::MessageStoreFactory->create(uri => 'imap://victoria:secret@foo.com:9143/inbox.foo');
99:    $self->assert($ms->{port} == 9143);
102:    $ms = Cassandane::MessageStoreFactory->create(uri => 'imap://victoria@foo.com:9143/inbox.foo');
107:    $self->assert($ms->{port} == 9143);
110:    $ms = Cassandane::MessageStoreFactory->create(uri => 'imap://foo.com:9143/inbox.foo');
115:    $self->assert($ms->{port} == 9143);

... though I don't think these ones actually start a service on that port, they're just testing that the object is created correctly, so they won't actually clash with anything nor care that the default range has changed.

Comment on lines 60 to 61
my $cassini_base_port = $cassini->val('cassandane', 'base_port') // 0;
$base_port = 0 + $cassini_base_port || 9100;
$base_port = 0 + $cassini_base_port || 29100;
Copy link
Contributor

Choose a reason for hiding this comment

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

Heh... $cassini->val() takes an optional third argument, the default value to use if no value was configured. So these two lines could have been one all along, like:

$base_port = 0 + $cassini->val('cassandane', 'base_port', '[2]9100');

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah! Done :)

@brong
Copy link
Member Author

brong commented Sep 9, 2024

I saw we ran into a 9100 port issue again recently, so would be great to merge this! @elliefm I did the patch for the default value thing you suggested

@brong brong requested a review from elliefm September 9, 2024 11:39
Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

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

Looks good, thanks :)

@ksmurchison ksmurchison merged commit a651631 into master Oct 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants