Skip to content

Conversation

@Kami
Copy link
Member

@Kami Kami commented Sep 19, 2019

This pull request updates code in st2reactor package so all the concurrency related operations are routed through our st2common.util.concurrency abstraction.

This way that code should work with either eventlet or gevent (e.g. eventlet doesn't work in combination with the grpc library).

This is similar as the change in #4713, but for the st2reactor package.

concurrency abstraction which works with either gevent or eventlet.
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Sep 19, 2019
@Kami Kami added this to the 3.2.0 milestone Sep 19, 2019
Copy link
Contributor

@m4dcoder m4dcoder left a comment

Choose a reason for hiding this comment

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

The change is OK. Looks like you included other unrelated changes (pip opts and token related in st2reactor). How are they related to the focus of this PR? Also, looks like the concurrency module can do with a better design than using a bunch of if/else. I'm not blocking here because the focus is on WaaS and I don't want you to get block here.

cfg.ListOpt(
'pip_opts', default=[],
help='List of pip options to be passed to "pip install" command when installing pack '
'dependencies into pack virtual environment.'),
Copy link
Contributor

Choose a reason for hiding this comment

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

What do these pip related changes have to do with the changes to not directly call eventlet?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally I would open separate PR for each of those set of changes, but I kinda wanted to avoid that.



def sleep(*args, **kwargs):
if CONCURRENCY_LIBRARY == 'eventlet':
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like there should be a better way to handle the eventlet vs. gevent driver than to use all these if/else across different methods in this module.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we get much with doing it differently.

We could abstract it some more, in some driver / plugin approach but that would be massive amount of work for very little value.

service=True)

env[API_URL_ENV_VARIABLE_NAME] = get_full_public_api_url()
env[AUTH_TOKEN_ENV_VARIABLE_NAME] = temporary_token.token
Copy link
Contributor

Choose a reason for hiding this comment

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

What do these token related changes have to do with the concurrency change?

@Kami Kami merged commit 92c7271 into master Oct 30, 2019
@Kami Kami deleted the reactor_gevent_adapter branch October 30, 2019 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR that changes 30-99 lines. Good size to review.

3 participants