Repository: buildbot/buildbot

Issue:
Worker port change requires master restart
Hi,

I just noticed that if I have a master waiting for connections at `16124` (for example):
```
c['protocols'] = {'pb': {'port': 16124}}
```
Then start a master and a worker connecting to the master at `9989`, as expected the worker won't be able to find the master since the master is listening to `16124`. However, I changed the above to:
```
c['protocols'] = {'pb': {'port': 9989}}
```

and then did a:
```
$ buildbot reconfig
```

It says everything went well but the worker still didn't connect. I had to issue a 
```
$ buildbot restart
```

I can't find this mentioned anywhere. Either it's a bug or we should document this.

This is with buildbot 0.9.11 on python 3.6.2.


Discussion:

Resolving patch:
diff --git a/master/buildbot/status/web/console.py b/master/buildbot/status/web/console.py
--- a/master/buildbot/status/web/console.py
+++ b/master/buildbot/status/web/console.py
@@ -316,7 +316,7 @@ def displayTags(self, builderList, debugInfo):
         for tag in builderList:
             count += len(builderList[tag])
 
-        tags = sorted(builderList.keys())
+        tags = util.naturalSort(builderList.keys())
 
         cs = []
 
diff --git a/master/buildbot/status/web/grid.py b/master/buildbot/status/web/grid.py
--- a/master/buildbot/status/web/grid.py
+++ b/master/buildbot/status/web/grid.py
@@ -13,6 +13,7 @@
 #
 # Copyright Buildbot Team Members
 
+from buildbot import util
 from buildbot.sourcestamp import SourceStamp
 from buildbot.status.web.base import HtmlResource
 from buildbot.status.web.base import build_get_class
@@ -205,7 +206,7 @@ def content(self, request, cxt):
                     'stamps': [map(SourceStamp.asDict, sstamp) for sstamp in stamps],
                     })
 
-        sortedBuilderNames = sorted(status.getBuilderNames())
+        sortedBuilderNames = util.naturalSort(status.getBuilderNames())
 
         cxt['builders'] = []
 
@@ -274,7 +275,7 @@ def content(self, request, cxt):
                     'stamps': [map(SourceStamp.asDict, sstamp) for sstamp in stamps],
                     })
 
-        sortedBuilderNames = sorted(status.getBuilderNames())
+        sortedBuilderNames = util.naturalSort(status.getBuilderNames())
 
         cxt['sorted_builder_names'] = sortedBuilderNames
         cxt['builder_builds'] = builder_builds = []
diff --git a/master/buildbot/status/web/waterfall.py b/master/buildbot/status/web/waterfall.py
--- a/master/buildbot/status/web/waterfall.py
+++ b/master/buildbot/status/web/waterfall.py
@@ -325,6 +325,7 @@ def content(self, request, cxt):
         for bldr in builders:
             tags = bldr.getTags()
             allTags.update(tags or [])
+        allTags = util.naturalSort(list(allTags))
         cxt['show_tags'] = show_tags
         cxt['all_tags'] = allTags
 
@@ -585,7 +586,7 @@ def with_args(req, remove_args=[], new_args=[], new_path=None):
         for builderName in builderNames:
             builder = status.getBuilder(builderName)
             tags.update(builder.getTags() or [])
-        tags = sorted(tags)
+        tags = util.naturalSort(list(tags))
         ctx['tags'] = tags
 
         template = request.site.buildbot_service.templates.get_template("waterfall.html")


Test patch: