Skip to content

Fixing issue #6019: unable to use mysql SSL parameters when getting mysql engine#6020

Merged
auvipy merged 2 commits into
celery:masterfrom
TriggerMail:master
Apr 2, 2020
Merged

Fixing issue #6019: unable to use mysql SSL parameters when getting mysql engine#6020
auvipy merged 2 commits into
celery:masterfrom
TriggerMail:master

Conversation

@alexagriffith

@alexagriffith alexagriffith commented Apr 1, 2020

Copy link
Copy Markdown

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

(Fixes #6019)

**kwargs for the mysql creat_engine() function were removed in the case that self.forked is False (94dae1b) due to issue #1903. However, this causes other database engine options to not be used, such as the SSL certs when the ResultSession is made. This fix ignores args in the database engine options that start with pool while still applying the others. A detailed description of this issue can be found at #6019.

https://docs.sqlalchemy.org/en/13/core/engines.html#sqlalchemy.create_engine.params.pool
The SQLalchemy documentation shows all of the possible engine args.
Here are the ones containing pool:
pool
poolclass
pool_logging_name
pool_pre_ping
pool_size
pool_recycle
pool_reset_on_return
pool_timeout
pool_use_lifo
echo_pool

In the description of pool_size it says: "to disable pooling, set poolclass to NullPool instead"
Therefore, none of these pool args will be needed since poolclass is set to NullPool.

@alexagriffith alexagriffith changed the title Fixing issue #6019: unable to use mysql SSL parametes in create_engine() Fixing issue #6019: unable to use mysql SSL parameters when getting mysql engine Apr 1, 2020

@auvipy auvipy 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.

please add test to show this won't regress! and thanks for tackling it!

@auvipy auvipy added this to the 4.4.x milestone Apr 2, 2020
@alexagriffith

Copy link
Copy Markdown
Author

@auvipy no problem! I'll work on the tests :)

@codecov

codecov Bot commented Apr 2, 2020

Copy link
Copy Markdown

Codecov Report

Merging #6020 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6020      +/-   ##
==========================================
+ Coverage   83.42%   83.42%   +<.01%     
==========================================
  Files         145      145              
  Lines       17185    17186       +1     
  Branches     2117     2118       +1     
==========================================
+ Hits        14337    14338       +1     
  Misses       2628     2628              
  Partials      220      220
Impacted Files Coverage Δ
celery/backends/database/session.py 97.77% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6957f7d...66cd964. Read the comment docs.

@alexagriffith

Copy link
Copy Markdown
Author

@auvipy I am having a little trouble setting up my env, docker-compose is failing. Im working on it currently, but are these continuous integration tests expected to fail?

@alexagriffith
alexagriffith requested a review from auvipy April 2, 2020 16:49
@auvipy

auvipy commented Apr 2, 2020

Copy link
Copy Markdown
Member

yes

@auvipy auvipy 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.

what is those two new files with no changes?

@alexagriffith

Copy link
Copy Markdown
Author

@auvipy that is weird! sorry, must have been from me trying to set up the env, and I overlooked it. I fixed it.

@alexagriffith
alexagriffith requested a review from auvipy April 2, 2020 18:24