Bug 690 - Reload fails when so-reuseport is yes (after changing num-threads)
Reload fails when so-reuseport is yes (after changing num-threads)
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.4
x86_64 Linux
: P5 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-23 19:17 CEST by Daisuke HIGASHI
Modified: 2015-07-24 09:06 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daisuke HIGASHI 2015-07-23 19:17:25 CEST
Platform: Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-24-generic x86_64)
(Also was repeatable on CentOS 6.5 x86_64)

Unbound fails to reload after changing number of threads
when "so-reuseport is yes".

How to repeat:

 1. start Unbound with "so-reuseport: yes, num-threads: 1"
 2. edit unbound.conf to "num-threads: 2"
 3. unbound-control reload

In addition, reload looks like to be success
when _decreasing_ num-threads (e.g. 2 to 1) but unbound stops to respond.


unbound.conf
-------------
server:
 num-threads: 1  # change to "num-threads: 2" causes fail to reload.
 so-reuseport: yes

 statistics-cumulative: yes
 extended-statistics: yes
 port: 1053
 msg-cache-size: 128m	
 rrset-cache-size: 128m
 do-daemonize: yes

 chroot: ""
 username: ""
 directory: "/home/dais/unbound/etc/unbound"
 logfile: "unbound.log"

remote-control:
 control-enable: yes
-------------

unbound.log
-------------
[1437671551] unbound[15285:0] info: start of service (unbound 1.5.4).
[1437671563] unbound[15285:0] debug: new control connection from ip4 127.0.0.1 port 43504 (len 16)
[1437671563] unbound[15285:0] debug: comm point stop listening 12
[1437671563] unbound[15285:0] debug: comm point start listening 12
[1437671563] unbound[15285:0] debug: remote control connection authenticated
[1437671563] unbound[15285:0] info: control cmd:  reload
[1437671563] unbound[15285:0] debug: remote control operation completed
[1437671563] unbound[15285:0] debug: close fd 12
[1437671563] unbound[15285:0] info: service stopped (unbound 1.5.4).
[1437671563] unbound[15285:0] debug: stop threads
[1437671563] unbound[15285:0] debug: cleanup.
[1437671563] unbound[15285:0] info: server stats for thread 0: 0 queries, 0 answers from cache, 0 recursions, 0 prefetch
[1437671563] unbound[15285:0] info: server stats for thread 0: requestlist max 0 avg 0 exceeded 0 jostled 0
[1437671563] unbound[15285:0] info: mesh has 0 recursion states (0 with reply, 0 detached), 0 waiting replies, 0 recursion replies sent, 0 replies dropped, 0 states jostled out
[1437671563] unbound[15285:0] debug: cache memory msg=66072 rrset=66072 infra=2632 val=66344
[1437671563] unbound[15285:0] notice: Restart of unbound 1.5.4.
[1437671563] unbound[15285:0] warning: too many file descriptors requested. The builtinmini-event cannot handle more than 1024. Config for less fds or compile with libevent
[1437671563] unbound[15285:0] warning: continuing with less udp ports: 465
[1437671563] unbound[15285:0] debug: switching log to unbound.log
[1437671563] unbound[15285:0] debug: module config: "validator iterator"
[1437671563] unbound[15285:0] notice: init module 0: validator
[1437671563] unbound[15285:0] debug: validator nsec3cfg keysz 1024 mxiter 150
[1437671563] unbound[15285:0] debug: validator nsec3cfg keysz 2048 mxiter 500
[1437671563] unbound[15285:0] debug: validator nsec3cfg keysz 4096 mxiter 2500
[1437671563] unbound[15285:0] notice: init module 1: iterator
[1437671563] unbound[15285:0] debug: target fetch policy for level 0 is 3
[1437671563] unbound[15285:0] debug: target fetch policy for level 1 is 2
[1437671563] unbound[15285:0] debug: target fetch policy for level 2 is 1
[1437671563] unbound[15285:0] debug: target fetch policy for level 3 is 0
[1437671563] unbound[15285:0] debug: target fetch policy for level 4 is 0
[1437671563] unbound[15285:0] debug: donotq: 127.0.0.0/8
[1437671563] unbound[15285:0] debug: donotq: ::1
[1437671563] unbound[15285:0] debug: total of 59521 outgoing ports available
[1437671563] unbound[15285:0] debug: start threads
[1437671563] unbound[15285:0] debug: event mini-event-1.5.4 uses not_obtainable method.
[1437671563] unbound[15285:1] debug: event mini-event-1.5.4 uses not_obtainable method.
[1437671563] unbound[15285:1] error: Could not open sockets to accept queries.
[1437671563] unbound[15285:1] error: could not create listening sockets
[1437671563] unbound[15285:19df0b0] fatal error: Could not initialize thread
Comment 1 Wouter Wijngaards 2015-07-24 09:06:57 CEST
Hi Daisuke,

Thank you for the report!

Fixed the fatal error, but the actual settings do not take effect.  It can only open extra ports after unbound is restarted.

Best regards, Wouter