SSL-related bug with websocket send call and multithreading

Open
#174 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
networking

Research direction

Start at ws4py.websocket.WebSocket.send and reproduce the report with SSL enabled, CherryPy, and multiple threads sending through one socket. Compare that behavior with non-SSL sockets and separate sockets per thread, using the reported Python and ws4py versions. Done means the concurrent SSL send case no longer combines messages or terminates the socket, with a regression test covering it.

Written by the indexing model from the issue text.

Description

hello everyone,
I bumped into a problem with the send method of ws4py.websocket.WebSocketwhen SSL is enabled.
I have a CherryPy server to which I associate some WebSocket servers. Messages are sent from a few independent threads through the same socket. This works fine without SSL.
However, with SSL enabled and more than one thread per socket, some messages end up being packed together and this makes the socket terminate.
If I open separate sockets for each thread, this works fine though.
I suspect there's something similar in essence as with this bug, i.e. difference on how SSL and non-SSL sockets treat pending data (correct me if I didn't get it right).
Any clues on why this may happen and how to fix it?

EDIT: I should add that I'm on OSX, didn't try on another system yet.
EDIT2: forgot also - CherryPy 3.8.0, ws4py 0.3.4, python 2.7.10 or 3.4.3

Dominant language
Python
Stars
1.1k
Forks
285
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Lawouach/WebSocket-for-Python

All issues in Lawouach/WebSocket-for-Python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.