Opened 10 years ago

Closed 10 years ago

#89 closed defect (fixed)

b10-cmdctl not shutting down

Reported by: jreed Owned by:
Priority: medium Milestone:
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: Add Hours to Ticket:
Total Hours: Internal?:

Description

I used bindctl to "Boss shutdown". bindctl kept running and showed:

  > Boss shutdown
  send the message to cmd-ctrld
  received reply: {"error": "[Errno 32] Broken pipe"}

I restarted bind10.

I tried:

  > Auth print_message testing
  send the message to cmd-ctrld
  received reply: {"error": "[Errno 32] Broken pipe"}

See the loop below:

...
Starting b10-cmdctl on port 8080
Started b10-cmdctl (PID 3046)
b10-cmdctl module is starting on :127.0.0.1 port:8080
Traceback (most recent call last):
  File "/home/reed/opt/bind10/libexec/bind10/b10-cmdctl", line 466, in 
<module>
    run(options.addr, options.port, options.idle_timeout)
  File "/home/reed/opt/bind10/libexec/bind10/b10-cmdctl", line 426, in 
run
    httpd = SecureHTTPServer((addr, port), SecureHTTPRequestHandler, 
idle_timeout)
  File "/home/reed/opt/bind10/libexec/bind10/b10-cmdctl", line 332, in 
__init__
    http.server.HTTPServer.__init__(self, server_address, 
RequestHandlerClass)
  File "/usr/pkg/lib/python3.1/socketserver.py", line 400, in __init__
    self.server_bind()
  File "/usr/pkg/lib/python3.1/http/server.py", line 127, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/pkg/lib/python3.1/socketserver.py", line 411, in 
server_bind
    self.socket.bind(self.server_address)
socket.error: [Errno 48] Address already in use
Process b10-cmdctl (PID 3046) died.
Process b10-cmdctl (PID 3046) died.
My local name is:  4b9e3b4c_5@t1.m.reedmedia.net
Server started.
Resurrecting dead b10-cmdctl process...
Resurrected b10-cmdctl (PID 27992)
b10-cmdctl module is starting on :127.0.0.1 port:8080
Traceback (most recent call last):
  File "/home/reed/opt/bind10/libexec/bind10/b10-cmdctl", line 466, in 
<module>
    run(options.addr, options.port, options.idle_timeout)
  File "/home/reed/opt/bind10/libexec/bind10/b10-cmdctl", line 426, in 
run
    httpd = SecureHTTPServer((addr, port), SecureHTTPRequestHandler, 
idle_timeout)
  File "/home/reed/opt/bind10/libexec/bind10/b10-cmdctl", line 332, in 
__init__
    http.server.HTTPServer.__init__(self, server_address, 
RequestHandlerClass)
  File "/usr/pkg/lib/python3.1/socketserver.py", line 400, in __init__
    self.server_bind()
  File "/usr/pkg/lib/python3.1/http/server.py", line 127, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/pkg/lib/python3.1/socketserver.py", line 411, in 
server_bind
    self.socket.bind(self.server_address)
socket.error: [Errno 48] Address already in use
Process b10-cmdctl (PID 27992) died.
b10-cmdctl send command 'print_message' to Auth
...

Oh, so I really do have a cmdctl still running even after I ctrl-c and stop bind10:

reed 29674  0.0  1.6 2060 14976 ttyp1 S     8:48AM   0:01.48 
/usr/pkg/bin/python3.1 /home/reed/opt/bind10/libexec/bind10/b10-cmdctl 

Subtickets

Change History (1)

comment:1 Changed 10 years ago by shane

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in commit 1411.

This is caused because the b10-cmdctl process was a fork & exec server. When the main b10-cmdctl process died, the child process(es) stayed around.

I converted this to a threaded server (a 2-line change), so now only one process will ever start, and we won't have any extras lying around.

Note: See TracTickets for help on using tickets.