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

fix missing import in socketrpc.py (branch 0.8) #681

Closed
wants to merge 1 commit into from

Conversation

Shuliyey
Copy link

@Shuliyey Shuliyey commented Nov 12, 2017

Issue

This pull-request is to branch 0.8.
Locust pure python RPC not working in distributed mode (this makes, message seem confusing) - (#680)

Currrent/Expected Behaviour

pure Python socket RPC implementation works (when pyzmq is not installed/detected)

~ # locust --host=http://qq.com --master
/usr/local/lib/python3.6/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.
  warnings.warn("WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.")
[2017-11-12 21:37:49,379] 1e2974af6aec/INFO/locust.main: Starting web monitor at *:8089
[2017-11-12 21:37:49,380] 1e2974af6aec/INFO/locust.main: Starting Locust 0.8.1

Previous Behavour

pure Python socket RPC implementation doesn't work (when pyzmq is not installed/detected)

~ # locust --host=http://qq.com --master
/usr/local/lib/python3.6/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.
  warnings.warn("WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.")
[2017-11-12 21:35:24,985] 1e2974af6aec/INFO/locust.main: Starting web monitor at *:8089
[2017-11-12 21:35:24,986] 1e2974af6aec/ERROR/stderr: Traceback (most recent call last):
[2017-11-12 21:35:24,986] 1e2974af6aec/ERROR/stderr: File "/usr/local/bin/locust", line 11, in <module>
[2017-11-12 21:35:24,987] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,987] 1e2974af6aec/ERROR/stderr: sys.exit(main())
[2017-11-12 21:35:24,988] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,988] 1e2974af6aec/ERROR/stderr: File "/usr/local/lib/python3.6/site-packages/locust/main.py", line 439, in main
[2017-11-12 21:35:24,989] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,989] 1e2974af6aec/ERROR/stderr: runners.locust_runner = MasterLocustRunner(locust_classes, options)
[2017-11-12 21:35:24,990] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,990] 1e2974af6aec/ERROR/stderr: File "/usr/local/lib/python3.6/site-packages/locust/runners.py", line 247, in __init__
[2017-11-12 21:35:24,991] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,992] 1e2974af6aec/ERROR/stderr: self.server = rpc.Server(self.master_bind_host, self.master_bind_port)
[2017-11-12 21:35:24,992] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,993] 1e2974af6aec/ERROR/stderr: File "/usr/local/lib/python3.6/site-packages/locust/rpc/socketrpc.py", line 74, in __init__
[2017-11-12 21:35:24,993] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,994] 1e2974af6aec/ERROR/stderr: self.event_queue = gevent.queue.Queue()
[2017-11-12 21:35:24,994] 1e2974af6aec/ERROR/stderr: 
[2017-11-12 21:35:24,994] 1e2974af6aec/ERROR/stderr: AttributeError
[2017-11-12 21:35:24,995] 1e2974af6aec/ERROR/stderr: :
[2017-11-12 21:35:24,995] 1e2974af6aec/ERROR/stderr: module 'gevent' has no attribute 'queue'
[2017-11-12 21:35:24,996] 1e2974af6aec/ERROR/stderr: 

@cgoldberg
Copy link
Member

0.8 is a release branch... this has already been taken care of in master (the rpc code was removed)

@cgoldberg cgoldberg closed this Nov 12, 2017
@Shuliyey
Copy link
Author

Shuliyey commented Nov 12, 2017

if 0.8 is a release branch, we need to release hot fix, if there're bugs in it right. e.g. increase maintenance version 0.8.2 (users could install this specific version)

the pip install locustio also installs the 0.8 branch by default

@cgoldberg
Copy link
Member

the rpc code has already been removed in master and this change will go out in the next release.

@Shuliyey
Copy link
Author

Shuliyey commented Nov 12, 2017

so this next release, is it a new major version from the master branch? e.g. 1.0 .1
or is it a new maintenance version from the master branch? e.g. 0.8.2

i can see the 0.8.1 version installed by pip install locustio is the code from the 0.8 branch

@cgoldberg
Copy link
Member

cgoldberg commented Nov 13, 2017 via email

@Shuliyey
Copy link
Author

Shuliyey commented Nov 13, 2017

so are we gonna leave branch 0.8 code as it is now, or we're merging master branch code into branch 0.8 (to abandon/remove the socketrpc.py file)? (because the current 0.8 branch has broken code in socketrpc.py)

@heyman
Copy link
Member

heyman commented Nov 14, 2017

The 0.8 version has a dependency on pyzmq (https://github.com/locustio/locust/blob/0.8/setup.py#L44) which means that if it's trying to import the pure socket implementation, something has already gone wrong since it failed to import zmq (see https://github.com/locustio/locust/blob/0.8/locust/rpc/__init__.py#L3-L7 and https://github.com/locustio/locust/blob/0.8/locust/rpc/zmqrpc.py#L1).

Therefore the real issue is how that can happen in the first place.

@Shuliyey
Copy link
Author

Shuliyey commented Nov 14, 2017

@heyman, if you want to know how this can happen in the first place, you can check this thread #302, there's an edge case for alpine (when g++ is uninstalled).

here's also an example https://github.com/Shuliyey/locust-docker (that demonstrates pyzmq installed but not detected by locust, after g++ is uninstalled on alpine)

The purpose of this pull request is to raise the fact that in 0.8 branch code, it tries to switch to the socketrpc.py implementation under the cases when pyzmq is not installed/detected. When this happens it outputs the message it will use pure python rpc implementation to run locust in distributed mode. However this socketrpc.py implementation is not working, hence we should either remove the socketrpc.py implementation from branch 0.8 (this way we throw an error instead of warning on pyzmq not installed/detected) or we could implement socketrpc.py correctly in branch 0.8

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.

None yet

3 participants