Skip to content

[Mailer] Add support of ping_threshold to SesTransportFactory #42219

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

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

Tyraelqp
Copy link
Contributor

@Tyraelqp Tyraelqp commented Jul 21, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? Yes
Deprecations? no
Tickets Fix #39044
License MIT
Doc PR symfony/symfony-docs#15557

Added support of ping_threshold option to SesTransportFactory for ses+smtp and ses+smtps schemes. Needed because SES closes SMTP connection after 10 seconds of inactivity and TransportException will be thrown on next send: Expected response code "250" but got code "451", with message "451 4.4.2 Timeout waiting for data from client.".

@carsonbot carsonbot added this to the 4.4 milestone Jul 21, 2021
@Tyraelqp Tyraelqp changed the title [Mailer] Add support of ping_threshold to SesTransportFactory (closes… [Mailer] Add support of ping_threshold to SesTransportFactory Jul 21, 2021
@OskarStark OskarStark requested a review from xabbuh July 21, 2021 13:22
@Nyholm
Copy link
Member

Nyholm commented Jul 22, 2021

Hm.. I would argue that this is a new feature. It should target 5.4.

@Tyraelqp
Copy link
Contributor Author

Hm.. I would argue that this is a new feature. It should target 5.4.

We have ping_threshold for a long time - it is part of SmtpTransport. But it was not implemented in Ses factory, and this looks more like a bug, because without this prop you can't use ses+smtp in background (messenger) without issues

@Nyholm
Copy link
Member

Nyholm commented Jul 22, 2021

Adding a new config option is a feature. It is currently not unusable in a background process. But I do understand it is painful and I agree that we should improve.

If I remember correctly, there is not a lot of changes in mailer between 4.4 and 5.4. The component is fairly stable. (I’m on my phone, cannot check now… I might be wrong).

It would not be an issue for you to keep using version 4.4 for other components and 5.4 for just mailer.

@Tyraelqp
Copy link
Contributor Author

@Nyholm I'm not using 4.4 and the target is 4.4 now because Oskar said in prev PR what target should be 4.4. I can open new PR to 5.4, it's not a problem. But i have several questions:

  • May/should i add restart_threshold too?
  • What if i'll set default value for ping_threshold to 8 or 9 (because SES closes SMTP connection after 10 seconds of inactivity) for SesSmtpTransport with possibility to override this value as in this PR?
  • What about documentation? Should i add something in docs repo?

@OskarStark
Copy link
Contributor

I would argue that the current implementation is not usable right now, that's why I would vote for a bugfix, ofc I am aware of the ne option new code -> new feature.

@nicolas-grekas WDYT?

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

That's edgy. This may be annoying enough to pass as a bugfix...

@Tyraelqp
Copy link
Contributor Author

@OskarStark @nicolas-grekas What do you think about default value? (second question from this comment #42219 (comment))

@OskarStark
Copy link
Contributor

I would fix this as a bugfix, and as a feature against 5.4 setting the default value to 8

@Tyraelqp
Copy link
Contributor Author

Tyraelqp commented Jul 22, 2021

I would fix this as a bugfix, and as a feature against 5.4 setting the default value to 8

Sorry, but i did not quite understand: leave this PR as is for 4.4, and open new one in 5.4 with default value?
I think it will be more correct to do vice versa: in 4.4 set default value to 8 (bugfix)[this is better fix than possibility to change value because works out of the box and does not requires any action from user/configuration], and in 5.4 add possibility to change value (feature)

@OskarStark
Copy link
Contributor

I agree, but the problem is, it would change the current behaviour, while just adding the possibility to set a value, can introduce new bugs, but will not break the current behaviour. Not sure I am to picky here.

@nicolas-grekas please decide 😄

@Tyraelqp
Copy link
Contributor Author

please decide

Option 1: default value in 4.4 and support of ping_threshold in 5.4
Option 2: default value in 5.4 and support of ping_threshold in 4.4

@Nyholm
Copy link
Member

Nyholm commented Jul 24, 2021

I'm not using 4.4 and the target is 4.4 now because Oskar said in prev PR what target should be 4.4. I can open new PR to 5.4, it's not a problem.

I see. Thank you. Since both Oskar and Nicolas think this can be merged in 4.4 that is okey.

May/should i add restart_threshold too?

Could you elaborate why that is needed?

What if i'll set default value for ping_threshold to 8 or 9 (because SES closes SMTP connection after 10 seconds of inactivity) for SesSmtpTransport with possibility to override this value as in this PR?

I prefer no default value. Just add the option to be able to set ping_threshold. We don't want to modify existing behavior.

What about documentation? Should i add something in docs repo?

Yes please. When the PR is merged, I would appriciate that you sent a PR to https://github.com/symfony/symfony-docs
Remember to target the correct branch.

@fabpot
Copy link
Member

fabpot commented Jul 25, 2021

Sorry to be the one to do this, but adding a new config is a new feature, no matter what. So, that's for 5.4.

@Tyraelqp Tyraelqp changed the base branch from 4.4 to 5.4 July 26, 2021 06:48
@Tyraelqp
Copy link
Contributor Author

Tyraelqp commented Jul 26, 2021

It is possible to reparse PR with @carsonbot to change tags and milestone?

Tyraelqp added a commit to Tyraelqp/symfony-docs that referenced this pull request Jul 26, 2021
@fabpot fabpot force-pushed the ticket_39044_4.4 branch from 7ab4dac to 2e50135 Compare July 26, 2021 08:07
@fabpot
Copy link
Member

fabpot commented Jul 26, 2021

Thank you @Tyraelqp.

@fabpot fabpot merged commit ff54513 into symfony:5.4 Jul 26, 2021
@OskarStark OskarStark modified the milestones: 4.4, 5.4 Jul 26, 2021
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jul 29, 2021
This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

[Mailer] ping_threshold for ses+smtp

Docs for symfony/symfony#42219

Commits
-------

7f54a27 [Mailer] ping_threshold for ses+smtp
This was referenced Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Mailer] SMTP transport with AWS SES: "Timeout waiting for data from client"
6 participants