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

Give the main WebSocketClient thread and AbstractWebSocket Timer a name #666

Closed
cjgriscom opened this issue Feb 14, 2018 · 2 comments · Fixed by #667 or #675
Closed

Give the main WebSocketClient thread and AbstractWebSocket Timer a name #666

cjgriscom opened this issue Feb 14, 2018 · 2 comments · Fixed by #667 or #675

Comments

@cjgriscom
Copy link

cjgriscom commented Feb 14, 2018

Only the read thread is assigned a name in a WebSocketClient instance. The main Runnable acquires a default name like "Thread-7". I'm working on an application where I need to identify threads and manage them, and it would be nice to be able to distinguish them purely by name instead of inspecting their stack trace.

According to oakkitten who it pointed out in this thread, the connect() method creates a writeThread field which is overwritten with a new WebsocketWriteThread when the thread runs. WebsocketWriteThread sets the name, but the thread started in the connect() method continues to run with the default name.

Additionally oakkitten noted that a new Timer is created in AbstractWebSocket and it also lacks a name.

@marci4
Copy link
Collaborator

marci4 commented Feb 14, 2018

Some threads are not named, e.g. the Timer in AbstractWebSocket

Expected Behavior

All threads, server and client, should have a non default name.

Current Behavior

Some threads, e.g. the timer, still have their default name.

Possible Solution

Set thread names!

Steps to Reproduce (for bugs)

  1. Start Server/Client
  2. Check for the thread names in the debugger

Context

Information only change

Your Environment

  • Version used: 1.3.7
  • Java version: -
  • Operating System and version: -
  • Endpoint Name and version: -
  • Link to your project: -

Include

  • Tests
  • Documentation

@marci4
Copy link
Collaborator

marci4 commented Feb 14, 2018

Thank you very much for creating this issue @cjgriscom.

Should be solved with #667.

Greetings
marci4

@marci4 marci4 reopened this Feb 24, 2018
marci4 added a commit to marci4/Java-WebSocket-Dev that referenced this issue Mar 5, 2018
@marci4 marci4 mentioned this issue Mar 5, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants