)]}'
{"bin/swift-object-server":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":30,"context_line":"import time"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def run_wsgi_one_server_per_port(conf_path, app_section, *args, **kwargs):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    Runs the object-server using one child worker process per unique device"},{"line_number":36,"context_line":"    port across all storage polices\u0027 rings."}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_192a9490","line":33,"updated":"2015-05-22 00:55:44.000000000","message":"(mental note: why is this not in wsgi.py?!)","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":30,"context_line":"import time"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def run_wsgi_one_server_per_port(conf_path, app_section, *args, **kwargs):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    Runs the object-server using one child worker process per unique device"},{"line_number":36,"context_line":"    port across all storage polices\u0027 rings."}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_33e30bdb","line":33,"in_reply_to":"7a016987_192a9490","updated":"2015-05-23 18:22:57.000000000","message":"It\u0027s currently specific to the object-server, which is the scope of my current change.  If someone wants to generalize this either for account and container servers OR to allow \u003e 1 worker per port, that can be done in a follow-on patch.\n\nAs such, this code is no more general than this file, so it resides in this file.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def run_wsgi_one_server_per_port(conf_path, app_section, *args, **kwargs):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    Runs the object-server using one child worker process per unique device"},{"line_number":36,"context_line":"    port across all storage polices\u0027 rings."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param conf_path: Path to paste.deploy style configuration file/directory"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_94288934","line":35,"updated":"2015-05-22 00:55:44.000000000","message":"(mental note: only one per? why not conf.get(\u0027workers\u0027)? verify that children don\u0027t actually sub-fork into workers somewhere downstream)","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def run_wsgi_one_server_per_port(conf_path, app_section, *args, **kwargs):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    Runs the object-server using one child worker process per unique device"},{"line_number":36,"context_line":"    port across all storage polices\u0027 rings."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param conf_path: Path to paste.deploy style configuration file/directory"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_13e6cfe7","line":35,"in_reply_to":"7a016987_94288934","updated":"2015-05-23 18:22:57.000000000","message":"That\u0027s more work and I\u0027m trying to limit the scope of this initial patch.  There\u0027s nothing precluding additional work to make that be the case, but I\u0027m not targeting it in this patch.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"                    # remaining tasks should not require elevated privileges"},{"line_number":145,"context_line":"                    drop_privileges(conf.get(\u0027user\u0027, \u0027swift\u0027), no_setsid\u003dTrue)"},{"line_number":146,"context_line":"                    run_server(conf, logger, sock)"},{"line_number":147,"context_line":"                    logger.notice(\u0027Child %d (port %d) exiting normally\u0027,"},{"line_number":148,"context_line":"                                  os.getpid(), port)"},{"line_number":149,"context_line":"                    return 0"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_b498256b","line":146,"updated":"2015-05-22 00:55:44.000000000","message":"(mental note: verify that the fork-child exception to \"no except Exception:\" rule applies here... if run_server tracebacks for any reason, bad things may happen somehow (it ends in the forked interpreter above os.fork()); note darrell employs raise SystemExit)","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"                    # remaining tasks should not require elevated privileges"},{"line_number":145,"context_line":"                    drop_privileges(conf.get(\u0027user\u0027, \u0027swift\u0027), no_setsid\u003dTrue)"},{"line_number":146,"context_line":"                    run_server(conf, logger, sock)"},{"line_number":147,"context_line":"                    logger.notice(\u0027Child %d (port %d) exiting normally\u0027,"},{"line_number":148,"context_line":"                                  os.getpid(), port)"},{"line_number":149,"context_line":"                    return 0"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_f3e8d3b4","line":146,"in_reply_to":"7a016987_b498256b","updated":"2015-05-23 18:22:57.000000000","message":"I can\u0027t parse this comment, can you elaborate?","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    logger.notice(\u0027Child %d (port %d) exiting normally\u0027,"},{"line_number":148,"context_line":"                                  os.getpid(), port)"},{"line_number":149,"context_line":"                    return 0"},{"line_number":150,"context_line":"                # parent"},{"line_number":151,"context_line":"                logger.notice(\u0027Started child %s for port %d\u0027, pid, port)"},{"line_number":152,"context_line":"                pids_by_port[port] \u003d pid"},{"line_number":153,"context_line":"                ports_by_pid[pid] \u003d port"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_f4e0ddce","line":150,"updated":"2015-05-22 00:55:44.000000000","message":"I can see it\u0027s parent, come on :-)\na\u003db #assign b to a","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    logger.notice(\u0027Child %d (port %d) exiting normally\u0027,"},{"line_number":148,"context_line":"                                  os.getpid(), port)"},{"line_number":149,"context_line":"                    return 0"},{"line_number":150,"context_line":"                # parent"},{"line_number":151,"context_line":"                logger.notice(\u0027Started child %s for port %d\u0027, pid, port)"},{"line_number":152,"context_line":"                pids_by_port[port] \u003d pid"},{"line_number":153,"context_line":"                ports_by_pid[pid] \u003d port"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_73d503e3","line":150,"in_reply_to":"7a016987_f4e0ddce","updated":"2015-05-23 18:22:57.000000000","message":"I disagree and think it adds additional emphasis that the outdent there ends the child portion (which always terminates w/exception or the \"return 0\").\n\nThis is often done as an if/else and deviating from that, I thought the comment was worth including.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"            assert bind_ports \u003d\u003d set(pids_by_port.keys())"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        # Now, we need to notice when a child process dies OR when any ring"},{"line_number":180,"context_line":"        # mtime changes.  To achieve this, we check for either every so often"},{"line_number":181,"context_line":"        # (period chosen for acceptable child-restart latency and \"busy wait\""},{"line_number":182,"context_line":"        # CPU usage)."}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_b443856b","line":179,"updated":"2015-05-22 00:55:44.000000000","message":"I would rather fork a special watcher child then subscribe it to kernel notification of changed file (of which Linux has 3 kinds (!)). If Roman can support esoteric bind() semantics in Linux, why not this, too? At least you won\u0027t end on the next Dave Jones\u0027 \"Userland Is Dumb\" presentation.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"            assert bind_ports \u003d\u003d set(pids_by_port.keys())"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        # Now, we need to notice when a child process dies OR when any ring"},{"line_number":180,"context_line":"        # mtime changes.  To achieve this, we check for either every so often"},{"line_number":181,"context_line":"        # (period chosen for acceptable child-restart latency and \"busy wait\""},{"line_number":182,"context_line":"        # CPU usage)."}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_13fdaf6d","line":179,"in_reply_to":"7a016987_b443856b","updated":"2015-05-23 18:22:57.000000000","message":"I considered wacky ionotify shiz, but decided to leave the implementation not requiring that.  I don\u0027t think the \"busy waiting\" here at 0.5 second intervals is worth worrying about.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        # CPU usage)."},{"line_number":183,"context_line":"        sleep(0.5)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        for child_pid in ports_by_pid.keys():"},{"line_number":186,"context_line":"            pid, status \u003d os.waitpid(child_pid, os.WNOHANG)"},{"line_number":187,"context_line":"            # non-zero pid means it exited with some status"},{"line_number":188,"context_line":"            if pid and os.WIFEXITED(status) or os.WIFSIGNALED(status):"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_94eac972","line":185,"updated":"2015-05-22 00:55:44.000000000","message":"Why probe specific pids instead of os.waitpid(-1, os.WNOHANG)? Filtering out grandchildren or something? Making len(ports_by_pid) calls twice a second here...","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        # CPU usage)."},{"line_number":183,"context_line":"        sleep(0.5)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        for child_pid in ports_by_pid.keys():"},{"line_number":186,"context_line":"            pid, status \u003d os.waitpid(child_pid, os.WNOHANG)"},{"line_number":187,"context_line":"            # non-zero pid means it exited with some status"},{"line_number":188,"context_line":"            if pid and os.WIFEXITED(status) or os.WIFSIGNALED(status):"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_d3fb9777","line":185,"in_reply_to":"7a016987_94eac972","updated":"2015-05-23 18:22:57.000000000","message":"I probably thought waitpid() needed to wait for a specific PID and didn\u0027t reread the syscall manpage to disabuse myself of that notion.\n\nI\u0027ll fix that (AFAIK, this is senselessly inefficient as you note).","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    if reserve \u003e 0:"},{"line_number":70,"context_line":"        utils.FALLOCATE_RESERVE \u003d reserve"},{"line_number":71,"context_line":"    # redirect errors to logger and close stdio"},{"line_number":72,"context_line":"    capture_stdio(logger)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def kill_children(*args):"},{"line_number":75,"context_line":"        \"\"\"Kills the entire process group.\"\"\""}],"source_content_type":"application/octet-stream","patch_set":13,"id":"3afb71cf_a0fb2e46","line":72,"updated":"2015-06-11 10:24:52.000000000","message":"I would prefer if possible we attempt to bind to all our sockets before we shuffle ourselves into the background in order to avoid a regression where the inability to start because the port is in use becomes inscrutable.\n\nSo this is the part that detaches us from swift-init - after this any errors don\u0027t make it into the logs are lost.  In the run_wsgi case we close stdout *after* we manage to bind to our port.  This makes it *so* much easier to deal with cases when you have orphaned processes stuck listening on ports you\u0027re trying to bind to... which unfortunately is more likely to bite you with this patch since you have so many more ports in the lottery.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    pids_by_port_index_pairs \u003d {}"},{"line_number":98,"context_line":"    port_index_pairs_by_pid \u003d {}"},{"line_number":99,"context_line":"    socks_by_port \u003d {}"},{"line_number":100,"context_line":"    desired_port_index_pairs \u003d None"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    while running[0]:"},{"line_number":103,"context_line":"        now \u003d time.time()"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"3afb71cf_8f005d03","line":100,"updated":"2015-06-11 10:24:52.000000000","message":"Since this is untested I think making this code as simple as possible should definitely be a primary goal over \"efficiency\" - worker management is not the critical improvement of this change.\n\nthis is a lot of state to carry around and keep in sync - i especially don\u0027t like the double direction dictionary - it seems like a single data model that can answer all the questions might simplify the code even if it means you can\u0027t always get directly to the key you need with an indexed lookup.  Cardinality is totally manageable here - I\u0027d be pretty keen to give up a little inefficient iteration if it gains us some simplicity.\n\nI\u0027m thinking:\n\n    {\n        \u0027port\u0027: (\n            \u003csocket\u003e, [\u003cpid1\u003e, \u003cpid2\u003e, ...]\n        ),\n        ....\n    }\n\nMaybe makes the values instances of a namedtuple so you can key into the dict by port and pick up the .socket or iterate the .workers.  A regular old class might work too...","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            try:"},{"line_number":185,"context_line":"                pid, status \u003d os.waitpid(-1, os.WNOHANG)"},{"line_number":186,"context_line":"            except OSError:"},{"line_number":187,"context_line":"                break"},{"line_number":188,"context_line":"            if not pid:"},{"line_number":189,"context_line":"                break"},{"line_number":190,"context_line":"            if os.WIFEXITED(status) or os.WIFSIGNALED(status):"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"3afb71cf_e0a6c6ac","line":187,"updated":"2015-06-11 10:24:52.000000000","message":"nit: I think it\u0027d be almost exactly the same, but maybe little easier to manage if you let eventlet do the non-blocking wait.\n\nhttps://gist.github.com/clayg/ad1cfc009c57d537ceca","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"d63087df591c7372744bd83db419add9bfa2dfd7","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                logger.error(\u0027Removing dead child %d (PID: %s) for port %s\u0027,"},{"line_number":193,"context_line":"                             server_idx, pid, dead_port)"},{"line_number":194,"context_line":"                del port_index_pairs_by_pid[pid]"},{"line_number":195,"context_line":"                pids_by_port_index_pairs.pop((dead_port, server_idx), None)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    # Fell out of main loop; close all listen sockets and exit."},{"line_number":198,"context_line":"    for sock in socks_by_port.values():"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"3afb71cf_bf2172fd","line":195,"updated":"2015-06-09 05:19:23.000000000","message":"You\u0027re using pop() here because the port-index pair may be missing from the dict, right? Does it really happen or just a precaution?","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"d625a9215fcc1f6f6f7e8b553f0ce71fe2eadac8","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                logger.error(\u0027Removing dead child %d (PID: %s) for port %s\u0027,"},{"line_number":193,"context_line":"                             server_idx, pid, dead_port)"},{"line_number":194,"context_line":"                del port_index_pairs_by_pid[pid]"},{"line_number":195,"context_line":"                pids_by_port_index_pairs.pop((dead_port, server_idx), None)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    # Fell out of main loop; close all listen sockets and exit."},{"line_number":198,"context_line":"    for sock in socks_by_port.values():"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"3afb71cf_50724f7c","line":195,"in_reply_to":"3afb71cf_bf2172fd","updated":"2015-06-09 15:31:06.000000000","message":"Precaution; it\u0027s certainly not *supposed* to get out of sync.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"}],"doc/source/deployment_guide.rst":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"The :ref:`threads_per_disk \u003cobject-server-options\u003e` option is one way to"},{"line_number":155,"context_line":"address this, but it comes with severe performance overhead which is worse"},{"line_number":156,"context_line":"than the benefit of I/O isolation."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"Another way to get full I/O isolation is to give each disk on a storage node a"},{"line_number":159,"context_line":"different port in the storage policy rings.  Then set the"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3afb71cf_1a14a94a","line":156,"updated":"2015-06-11 10:24:52.000000000","message":"nit: Probably want to go ahead and ding threads per disk somewhere and point folks over here?","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"The :ref:`threads_per_disk \u003cobject-server-options\u003e` option is one way to"},{"line_number":155,"context_line":"address this, but it comes with severe performance overhead which is worse"},{"line_number":156,"context_line":"than the benefit of I/O isolation."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"Another way to get full I/O isolation is to give each disk on a storage node a"},{"line_number":159,"context_line":"different port in the storage policy rings.  Then set the"}],"source_content_type":"text/x-rst","patch_set":13,"id":"1af86dd1_26585856","line":156,"in_reply_to":"3afb71cf_1a14a94a","updated":"2015-06-12 00:25:06.000000000","message":"I got a little more opinionated in the next patch set.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":162,"context_line":"setting is to run one or more object-server worker processes per *disk*, the"},{"line_number":163,"context_line":"implementation just runs object-servers per unique port of local devices in the"},{"line_number":164,"context_line":"rings.  The deployer must combine this option with appropriately-configured"},{"line_number":165,"context_line":"rings to benefit from this feature."},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"If you do not run a separate object-server for replication, then this setting"},{"line_number":168,"context_line":"must be available to the object-replicator and object-reconstructor (i.e."}],"source_content_type":"text/x-rst","patch_set":13,"id":"3afb71cf_d566e2eb","line":165,"updated":"2015-06-11 10:24:52.000000000","message":"nit: I think a before and after table that describes what the appropriately-configured rings would look like would go a long way.\n\nWhat\u0027s the upgrade story?  Maybe start with old rings and then turn on  workers_per_port (maybe sorta high worker count since it\u0027ll be handling requests for multiple devices?) then push out rings that pull some devices onto their own ports and reduce worker could?","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":162,"context_line":"setting is to run one or more object-server worker processes per *disk*, the"},{"line_number":163,"context_line":"implementation just runs object-servers per unique port of local devices in the"},{"line_number":164,"context_line":"rings.  The deployer must combine this option with appropriately-configured"},{"line_number":165,"context_line":"rings to benefit from this feature."},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"If you do not run a separate object-server for replication, then this setting"},{"line_number":168,"context_line":"must be available to the object-replicator and object-reconstructor (i.e."}],"source_content_type":"text/x-rst","patch_set":13,"id":"1af86dd1_c64e2496","line":165,"in_reply_to":"3afb71cf_d566e2eb","updated":"2015-06-12 00:25:06.000000000","message":"done.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":170,"context_line":"object-server for replication, then you have the option of also using"},{"line_number":171,"context_line":"`servers_per_port` for replication or to run replication \"normally\" with each"},{"line_number":172,"context_line":"ring\u0027s device having a single replication_port value but different port"},{"line_number":173,"context_line":"values."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":".. _general-service-configuration:"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"3afb71cf_fa61cd05","line":173,"updated":"2015-06-11 10:24:52.000000000","message":"I would prefer you update the wording here.\n\n\"having a single replication_port value but *different port values\"\n\nsingle or different?  a single value right - not different?  Different would be bad in all cases except when it matches the bind_port in the replication config?","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":170,"context_line":"object-server for replication, then you have the option of also using"},{"line_number":171,"context_line":"`servers_per_port` for replication or to run replication \"normally\" with each"},{"line_number":172,"context_line":"ring\u0027s device having a single replication_port value but different port"},{"line_number":173,"context_line":"values."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":".. _general-service-configuration:"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"1af86dd1_e6492090","line":173,"in_reply_to":"3afb71cf_fa61cd05","updated":"2015-06-12 00:25:06.000000000","message":"I cut some of this paragraph for clarity (at the expense of completeness?).","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"4008ba8c9619bb5fe2554f87fa830c293393a495","unresolved":false,"context_lines":[{"line_number":152,"context_line":"object servers from fully utilizing all their disks during heavy load."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"The :ref:`threads_per_disk \u003cobject-server-options\u003e` option was one way to"},{"line_number":155,"context_line":"address this, but came with severe performance overhead which was worse"},{"line_number":156,"context_line":"than the benefit of I/O isolation.  Any clusters using threads_per_disk should"},{"line_number":157,"context_line":"switch to using `servers_per_port`."},{"line_number":158,"context_line":""}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_a71d2c75","line":155,"updated":"2015-06-15 11:10:11.000000000","message":"(nits) s/servere/server/","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":152,"context_line":"object servers from fully utilizing all their disks during heavy load."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"The :ref:`threads_per_disk \u003cobject-server-options\u003e` option was one way to"},{"line_number":155,"context_line":"address this, but came with severe performance overhead which was worse"},{"line_number":156,"context_line":"than the benefit of I/O isolation.  Any clusters using threads_per_disk should"},{"line_number":157,"context_line":"switch to using `servers_per_port`."},{"line_number":158,"context_line":""}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_40c0aae0","line":155,"in_reply_to":"fa32b979_a71d2c75","updated":"2015-06-15 18:58:38.000000000","message":"As Pete pointed out in another file, \"severe\" is the correct word, here.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"f0e9a78e1b68151105a75498880918248ee6c7ee","unresolved":false,"context_lines":[{"line_number":165,"context_line":"rings.  The deployer must combine this option with appropriately-configured"},{"line_number":166,"context_line":"rings to benefit from this feature."},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"Here\u0027s an example (abbreviated) old-style ring (2 node cluster with 3 disks"},{"line_number":169,"context_line":"each)::"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":" Devices:    id  region  zone      ip address  port  replication ip  replication port      name"}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_934640be","line":168,"updated":"2015-06-14 02:50:49.000000000","message":"sure looks like 2 disks each to me","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":165,"context_line":"rings.  The deployer must combine this option with appropriately-configured"},{"line_number":166,"context_line":"rings to benefit from this feature."},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"Here\u0027s an example (abbreviated) old-style ring (2 node cluster with 3 disks"},{"line_number":169,"context_line":"each)::"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":" Devices:    id  region  zone      ip address  port  replication ip  replication port      name"}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_60ab6e1e","line":168,"in_reply_to":"fa32b979_934640be","updated":"2015-06-15 18:58:38.000000000","message":"Crap, #willfix","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"f0e9a78e1b68151105a75498880918248ee6c7ee","unresolved":false,"context_lines":[{"line_number":177,"context_line":"And here\u0027s the same ring set up for `servers_per_port`::"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":" Devices:    id  region  zone      ip address  port  replication ip  replication port      name"},{"line_number":180,"context_line":"              0       1     1       1.1.0.1    6000       1.0.0.1                6006      d1  "},{"line_number":181,"context_line":"              1       1     1       1.1.0.1    6001       1.0.0.1                6007      d2  "},{"line_number":182,"context_line":"              2       1     2       1.1.0.2    6000       1.0.0.2                6006      d3  "},{"line_number":183,"context_line":"              3       1     2       1.1.0.2    6001       1.0.0.2                6007      d4   "}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_531758a3","line":180,"updated":"2015-06-14 02:50:49.000000000","message":"This example leaves an impression that separate replication network is necessary for servers_per_port mode. But it is not required, is it?","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":177,"context_line":"And here\u0027s the same ring set up for `servers_per_port`::"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":" Devices:    id  region  zone      ip address  port  replication ip  replication port      name"},{"line_number":180,"context_line":"              0       1     1       1.1.0.1    6000       1.0.0.1                6006      d1  "},{"line_number":181,"context_line":"              1       1     1       1.1.0.1    6001       1.0.0.1                6007      d2  "},{"line_number":182,"context_line":"              2       1     2       1.1.0.2    6000       1.0.0.2                6006      d3  "},{"line_number":183,"context_line":"              3       1     2       1.1.0.2    6001       1.0.0.2                6007      d4   "}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_c0735ae6","line":180,"in_reply_to":"fa32b979_531758a3","updated":"2015-06-15 18:58:38.000000000","message":"Good catch--I think that was unintentional.  #willfix","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"a6797bf75393c7c16229780b11deb813bca7c587","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                                 how many worker processes run for each port"},{"line_number":438,"context_line":"                                 (disk) in the ring.  If you have 24 disks"},{"line_number":439,"context_line":"                                 per server, and this setting is 4, then"},{"line_number":440,"context_line":"                                 each storage node will have 1 + (24 * 4) \u003d"},{"line_number":441,"context_line":"                                 97 total object-server processes running."},{"line_number":442,"context_line":"                                 This gives complete I/O isolation, drastically"},{"line_number":443,"context_line":"                                 reducing the impact of slow disks on storage"}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_3de113d1","line":440,"updated":"2015-06-15 19:05:19.000000000","message":"Have any tests been run against a storage node with 90 disks per server?  Would that result in 361 total object-server processes running?  How would this number change if you are also running separate object servers for replication?","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"6bbfd980900f7e1c383673acb49fc3300e1d6c99","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                                 how many worker processes run for each port"},{"line_number":438,"context_line":"                                 (disk) in the ring.  If you have 24 disks"},{"line_number":439,"context_line":"                                 per server, and this setting is 4, then"},{"line_number":440,"context_line":"                                 each storage node will have 1 + (24 * 4) \u003d"},{"line_number":441,"context_line":"                                 97 total object-server processes running."},{"line_number":442,"context_line":"                                 This gives complete I/O isolation, drastically"},{"line_number":443,"context_line":"                                 reducing the impact of slow disks on storage"}],"source_content_type":"text/x-rst","patch_set":16,"id":"fa32b979_69c5993a","line":440,"in_reply_to":"fa32b979_3de113d1","updated":"2015-06-15 20:08:24.000000000","message":"I have not characterized the optimal tunable value for all sets of hardware; my testing covered only the 29 and 31-disk bare-metal chassis I had ready access to.\n\nBut, yes, 90-disk chassis with severs_per_port\u003d4 would indeed equate to 1 + (90 * 4) \u003d 361 processes.  That\u0027s probably too many, depending on the context-switching overhead and the amount of RAM in the box.  OTOH, actual benchmarking is key.\n\nBut servers_per_port is guaranteed to be better than threads_per_disk and almost certainly still better than only \"normal\" workers with even a single slow disk.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"}],"etc/object-server.conf-sample":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"453fb42aca947da8cb7a295b05bd8586fae3fa13","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# expiring_objects_account_name \u003d expiring_objects"},{"line_number":13,"context_line":"#"},{"line_number":14,"context_line":"# Use an integer to override the number of pre-forked processes that will"},{"line_number":15,"context_line":"# accept connections."},{"line_number":16,"context_line":"# workers \u003d auto"},{"line_number":17,"context_line":"#"},{"line_number":18,"context_line":"# Make object-server run one worker process per unique port of \"local\" ring"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_db8bd41d","line":15,"updated":"2015-05-22 00:55:44.000000000","message":"\", unless server_per_port is set\".... or is it","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# expiring_objects_account_name \u003d expiring_objects"},{"line_number":13,"context_line":"#"},{"line_number":14,"context_line":"# Use an integer to override the number of pre-forked processes that will"},{"line_number":15,"context_line":"# accept connections."},{"line_number":16,"context_line":"# workers \u003d auto"},{"line_number":17,"context_line":"#"},{"line_number":18,"context_line":"# Make object-server run one worker process per unique port of \"local\" ring"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"7a016987_73be23af","line":15,"in_reply_to":"7a016987_db8bd41d","updated":"2015-05-23 18:22:57.000000000","message":"Good point; will fix.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"4008ba8c9619bb5fe2554f87fa830c293393a495","unresolved":false,"context_lines":[{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"# Make object-server run this many worker processes per unique port of"},{"line_number":20,"context_line":"# \"local\" ring devices across all storage policies.  This can help provide"},{"line_number":21,"context_line":"# the isolation of threads_per_disk without the severe overhead.  The default"},{"line_number":22,"context_line":"# value of 0 disables this feature."},{"line_number":23,"context_line":"# servers_per_port \u003d 0"},{"line_number":24,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":16,"id":"fa32b979_fc43d06a","line":21,"updated":"2015-06-15 11:10:11.000000000","message":"(Nits) s/servere/server/","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e3b720cdbe3bf0fbba2751bc525cf3d71b396ede","unresolved":false,"context_lines":[{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"# Make object-server run this many worker processes per unique port of"},{"line_number":20,"context_line":"# \"local\" ring devices across all storage policies.  This can help provide"},{"line_number":21,"context_line":"# the isolation of threads_per_disk without the severe overhead.  The default"},{"line_number":22,"context_line":"# value of 0 disables this feature."},{"line_number":23,"context_line":"# servers_per_port \u003d 0"},{"line_number":24,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":16,"id":"fa32b979_a6c4235f","line":21,"in_reply_to":"fa32b979_620cd994","updated":"2015-06-16 01:25:25.000000000","message":"@Pete\n\nOIC, that\u0027s my fault. It\u0027s no matter.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"06c78d8e86cea45117f90a7710ff53ac9c4cbeb3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"# Make object-server run this many worker processes per unique port of"},{"line_number":20,"context_line":"# \"local\" ring devices across all storage policies.  This can help provide"},{"line_number":21,"context_line":"# the isolation of threads_per_disk without the severe overhead.  The default"},{"line_number":22,"context_line":"# value of 0 disables this feature."},{"line_number":23,"context_line":"# servers_per_port \u003d 0"},{"line_number":24,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":16,"id":"fa32b979_620cd994","line":21,"in_reply_to":"fa32b979_fc43d06a","updated":"2015-06-15 17:11:23.000000000","message":"\"Severe\" is an adjective that means extreme, so I think it\u0027s okay (「ひどいオーバーヘッド」かな).","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"}],"swift/common/ring/ring.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        json_len, \u003d struct.unpack(\u0027!I\u0027, gz_file.read(4))"},{"line_number":49,"context_line":"        ring_dict \u003d json.loads(gz_file.read(json_len))"},{"line_number":50,"context_line":"        if header_only:"},{"line_number":51,"context_line":"            return ring_dict"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        ring_dict[\u0027replica2part2dev_id\u0027] \u003d []"},{"line_number":54,"context_line":"        partition_count \u003d 1 \u003c\u003c (32 - ring_dict[\u0027part_shift\u0027])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_75bdeed6","line":51,"updated":"2015-06-11 10:24:52.000000000","message":"nit: Maybe just extract the two lines above into deserialize_v1_header and then call that method from here and the other place that needs that behavior?\n\nmeh i guess the return value is always a dict with the key for devs - it\u0027s just a question if has the replica2part2dev_id key or not..","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        else:"},{"line_number":81,"context_line":"            # Assume old-style pickled ring"},{"line_number":82,"context_line":"            gz_file.seek(0)"},{"line_number":83,"context_line":"            return gz_file, \u0027pickle\u0027, None"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    @classmethod"},{"line_number":86,"context_line":"    def load_devices(cls, filename):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_d5cf0254","line":83,"updated":"2015-06-11 10:24:52.000000000","message":"nit: a two tuple is normally my limit, at three I start to think about returning a dict - it\u0027s more self documenting and easier to add stuff too.  Either way this is a pretty low level interface - maybe make it an under method?","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            ring_data \u003d pickle.load(gz_file)"},{"line_number":105,"context_line":"            if not hasattr(ring_data, \u0027devs\u0027):"},{"line_number":106,"context_line":"                return ring_data[\u0027devs\u0027]"},{"line_number":107,"context_line":"            return ring_data.devs"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    @classmethod"},{"line_number":110,"context_line":"    def load(cls, filename):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_d58702b3","line":107,"updated":"2015-06-11 10:24:52.000000000","message":"nit: gah, so we\u0027ve grown another function that needs to keep track of all the different possible ways we\u0027ve historically stored ring data.\n\n* pickle of the class\n* json of the dict\n* json + struct R1NG","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            return ring_data.devs"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    @classmethod"},{"line_number":110,"context_line":"    def load(cls, filename):"},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        Load ring data from a file."},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_27ef4d1f","line":110,"updated":"2015-06-11 10:24:52.000000000","message":"nit: I sorta think if instead of the new load_devices we just plumbed header_only through here and let the deserialize _v1 method return a dict with the replica2part2dev_id key empty...\n\nYou could come out on the other side with a RingData instance that in the one ring format that supports it just doesn\u0027t have that attribute populated...\n\nThere was some situation recently (part power adjustment?) where we imagined how it\u0027d be handy if the object-server could know part_shift without having to load the whole ring...","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            return ring_data.devs"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    @classmethod"},{"line_number":110,"context_line":"    def load(cls, filename):"},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        Load ring data from a file."},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_5002d20c","line":110,"in_reply_to":"3afb71cf_27ef4d1f","updated":"2015-06-12 00:25:06.000000000","message":"All this shit will be better in the next patch.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"a6797bf75393c7c16229780b11deb813bca7c587","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                dev.setdefault(\"region\", 1)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @classmethod"},{"line_number":47,"context_line":"    def deserialize_v1(cls, gz_file, metadata_only\u003dFalse):"},{"line_number":48,"context_line":"        json_len, \u003d struct.unpack(\u0027!I\u0027, gz_file.read(4))"},{"line_number":49,"context_line":"        ring_dict \u003d json.loads(gz_file.read(json_len))"},{"line_number":50,"context_line":"        ring_dict[\u0027replica2part2dev_id\u0027] \u003d []"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_dd44a775","line":47,"updated":"2015-06-15 19:05:19.000000000","message":"This seems like a good time to add a doc string.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"a6797bf75393c7c16229780b11deb813bca7c587","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        \"\"\""},{"line_number":64,"context_line":"        Load ring data from a file."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        :param filename: Path to a file serialized by the save() method."},{"line_number":67,"context_line":"        :returns: A RingData instance containing the loaded data."},{"line_number":68,"context_line":"        \"\"\""},{"line_number":69,"context_line":"        gz_file \u003d GzipFile(filename, \u0027rb\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_7df8fb49","line":66,"updated":"2015-06-15 19:05:19.000000000","message":"Add metadata_only to docstring params.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"}],"swift/common/ring/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    To support accurate locality determination in the server-per-port"},{"line_number":239,"context_line":"    deployment, when my_port is None, only IP addresses are used for"},{"line_number":240,"context_line":"    determining locality (dev_port is ignored)."},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    If dev_ip is a hostname then it is first translated to an IP"},{"line_number":243,"context_line":"    address before checking it against my_ips."}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_60c2cb54","line":240,"updated":"2015-06-11 10:24:52.000000000","message":"Ideally this function could just *always* do this and people can update their development environments.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    To support accurate locality determination in the server-per-port"},{"line_number":239,"context_line":"    deployment, when my_port is None, only IP addresses are used for"},{"line_number":240,"context_line":"    determining locality (dev_port is ignored)."},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    If dev_ip is a hostname then it is first translated to an IP"},{"line_number":243,"context_line":"    address before checking it against my_ips."}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_79a26b9c","line":240,"in_reply_to":"3afb71cf_60c2cb54","updated":"2015-06-12 00:25:06.000000000","message":"I vaguely remember something forcing me to back off of making the vsaio always give the 4 \"servers\" different IPs... I\u0027d have to 1) make sure I did actually back off of that; and 2) try to remember why.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"d63087df591c7372744bd83db419add9bfa2dfd7","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    for dev_ip in candidate_ips:"},{"line_number":265,"context_line":"        if dev_ip in my_ips and (my_port is None or dev_port \u003d\u003d my_port):"},{"line_number":266,"context_line":"            return True"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"def parse_search_value(search_value):"},{"line_number":270,"context_line":"    \"\"\"The \u003csearch-value\u003e can be of the form::"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_c2f3359d","line":267,"updated":"2015-06-09 05:19:23.000000000","message":"return False  # don\u0027t make reviewers to search if you split None from False in a caller somewhere","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"d625a9215fcc1f6f6f7e8b553f0ce71fe2eadac8","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    for dev_ip in candidate_ips:"},{"line_number":265,"context_line":"        if dev_ip in my_ips and (my_port is None or dev_port \u003d\u003d my_port):"},{"line_number":266,"context_line":"            return True"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"def parse_search_value(search_value):"},{"line_number":270,"context_line":"    \"\"\"The \u003csearch-value\u003e can be of the form::"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_101617f1","line":267,"in_reply_to":"3afb71cf_c2f3359d","updated":"2015-06-09 15:31:06.000000000","message":"#willfix","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"f0e9a78e1b68151105a75498880918248ee6c7ee","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    for dev_ip in candidate_ips:"},{"line_number":265,"context_line":"        if dev_ip in my_ips and (my_port is None or dev_port \u003d\u003d my_port):"},{"line_number":266,"context_line":"            return True"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"def parse_search_value(search_value):"},{"line_number":270,"context_line":"    \"\"\"The \u003csearch-value\u003e can be of the form::"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_a8a43f08","line":267,"updated":"2015-06-14 02:50:49.000000000","message":"You promised to add  return False  here but didn\u0027t. Changed mind or forgot?","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    for dev_ip in candidate_ips:"},{"line_number":265,"context_line":"        if dev_ip in my_ips and (my_port is None or dev_port \u003d\u003d my_port):"},{"line_number":266,"context_line":"            return True"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"def parse_search_value(search_value):"},{"line_number":270,"context_line":"    \"\"\"The \u003csearch-value\u003e can be of the form::"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_a073b67f","line":267,"in_reply_to":"fa32b979_a8a43f08","updated":"2015-06-15 18:58:38.000000000","message":"just forgot ;)","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"}],"swift/common/storage_policy.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":"    Given a swift_dir, an iterable of IP addresses identifying a storage"},{"line_number":37,"context_line":"    backend server, and an mtime-caching dictionary, return a set of all bind"},{"line_number":38,"context_line":"    ports defined in all rings for this storage backend server."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    If no rings have changed, according to the cached mtimes in"},{"line_number":41,"context_line":"    mtimes_by_ring_name, then None is returned."}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_1ad389d6","line":38,"updated":"2015-06-11 10:24:52.000000000","message":"nit: you don\u0027t see the byo-mutable-caching-dictionary pattern too much in python.  Reminds me of all my confusion about deepcopy\u0027s cache dict!\n\nI think it\u0027d be better to spin this out as a class and let it handle it\u0027s own state.  It can keep around a list of ports for it\u0027s ip\u0027s pretty cheap (less than 1000 seems reasonable), and then the interface of \"sometimes returning None\" changes to \"always returns the ports\".  From there it\u0027s just an implementation detail that sometimes it\u0027ll have to read some stuff of disk first if the ports have changed, or sometimes it\u0027ll have to stat the files if it hadn\u0027t already done so in the last 5-10 seconds.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":"    Given a swift_dir, an iterable of IP addresses identifying a storage"},{"line_number":37,"context_line":"    backend server, and an mtime-caching dictionary, return a set of all bind"},{"line_number":38,"context_line":"    ports defined in all rings for this storage backend server."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    If no rings have changed, according to the cached mtimes in"},{"line_number":41,"context_line":"    mtimes_by_ring_name, then None is returned."}],"source_content_type":"text/x-python","patch_set":13,"id":"1af86dd1_12c1122f","line":38,"in_reply_to":"3afb71cf_1ad389d6","updated":"2015-06-12 00:25:06.000000000","message":"Most of this crap should be cleaned up/better in next patchset.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    for policy in POLICIES:"},{"line_number":50,"context_line":"        # NOTE: we must NOT use policy.load_ring to load the ring.  Users of"},{"line_number":51,"context_line":"        # this utility function will not need the actual ring data, just the"},{"line_number":52,"context_line":"        # bind ports."},{"line_number":53,"context_line":"        #"},{"line_number":54,"context_line":"        # This is duplicated with Ring.__init__ just a bit..."},{"line_number":55,"context_line":"        serialized_path \u003d os.path.join(swift_dir,"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_7abdddd6","line":52,"updated":"2015-06-11 10:24:52.000000000","message":"Yeah so load_ring is gunna hang it off the global policy collection... but FWIW I don\u0027t think there\u0027s any worries about parsing the ring file and loading an instance of the ring object here - the goal should just be that we don\u0027t want any references to those objects to leak out here.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            mtimes_by_ring_name[policy.ring_name] \u003d new_mtime"},{"line_number":63,"context_line":"            # No \"break\" here so all rings will be in ring_paths and"},{"line_number":64,"context_line":"            # mtimes_by_ring_name will get fully updated (if at more than one"},{"line_number":65,"context_line":"            # ring has a newer mtime)."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    if not any_ring_changed:"},{"line_number":68,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_bafb5546","line":65,"updated":"2015-06-11 10:24:52.000000000","message":"why does that matter?  If we\u0027re gunna load \u0027em all let\u0027s just do it!","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    if not any_ring_changed:"},{"line_number":68,"context_line":"        return None"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    bind_ports \u003d set()"},{"line_number":71,"context_line":"    for ring_path in ring_paths:"},{"line_number":72,"context_line":"        devs \u003d RingData.load_devices(ring_path)"},{"line_number":73,"context_line":"        bind_ports \u003d bind_ports.union(set("}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_faa66dac","line":70,"updated":"2015-06-11 10:24:52.000000000","message":"nit: If *any* ring changes we have to load them all right?  What\u0027s the serialized paths for then - can\u0027t we just iterate over policies again?\n\nreturn set(d[\u0027port\u0027] for p in POLICIES for d in Ring(swift_dir, ring_name\u003dp.ring_name).devs if d and d[\u0027ip\u0027] in my_ips)","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"d63087df591c7372744bd83db419add9bfa2dfd7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    bind_ports \u003d set()"},{"line_number":71,"context_line":"    for ring_path in ring_paths:"},{"line_number":72,"context_line":"        devs \u003d RingData.load_devices(ring_path)"},{"line_number":73,"context_line":"        bind_ports \u003d bind_ports.union(set("},{"line_number":74,"context_line":"            dev[\u0027port\u0027] for dev in devs"},{"line_number":75,"context_line":"            if dev and dev[\u0027ip\u0027] in my_ips))"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_fd149244","line":73,"updated":"2015-06-09 05:19:23.000000000","message":"You\u0027re the guy who taught me defaultdict(int) and yet missed bind_ports |\u003d set(); consistent with ring_paths.add() above though.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"d625a9215fcc1f6f6f7e8b553f0ce71fe2eadac8","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    bind_ports \u003d set()"},{"line_number":71,"context_line":"    for ring_path in ring_paths:"},{"line_number":72,"context_line":"        devs \u003d RingData.load_devices(ring_path)"},{"line_number":73,"context_line":"        bind_ports \u003d bind_ports.union(set("},{"line_number":74,"context_line":"            dev[\u0027port\u0027] for dev in devs"},{"line_number":75,"context_line":"            if dev and dev[\u0027ip\u0027] in my_ips))"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_d0bd1fb8","line":73,"in_reply_to":"3afb71cf_fd149244","updated":"2015-06-09 15:31:06.000000000","message":"I clearly use defaultdict more frequently than overloaded operators for sets ;).\n\nI don\u0027t plan to change this, as I find this immediately clear, if slightly more verbose.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"490af9f97f64e01dbc93e5d40bc50fac1300fe93","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                continue"},{"line_number":67,"context_line":"            old_mtime \u003d self.mtimes_by_ring_path.get(serialized_path)"},{"line_number":68,"context_line":"            if not old_mtime or old_mtime !\u003d new_mtime:"},{"line_number":69,"context_line":"                changed_rings.add(serialized_path)"},{"line_number":70,"context_line":"                self.mtimes_by_ring_path[serialized_path] \u003d new_mtime"},{"line_number":71,"context_line":"                # No \"break\" here so that the above line will update the"},{"line_number":72,"context_line":"                # mtimes_by_ring_path entry for any ring that changes, not just"}],"source_content_type":"text/x-python","patch_set":14,"id":"1af86dd1_bd40cf08","line":69,"updated":"2015-06-12 00:39:24.000000000","message":"nit: wtf?  why not just updat eportsets_by_ring_path right here?  w/e","commit_id":"69f3b53677ad8af5c5dc0ac71d63b31c3c2bc5b3"}],"swift/common/utils.py":[{"author":{"_account_id":5600,"name":"Brian Cline","email":"bcline@softlayer.com","username":"briancline"},"change_message_id":"4307a185a33a53be15d812ada22c197a4956e1cf","unresolved":false,"context_lines":[{"line_number":1601,"context_line":"    os.setgid(user[3])"},{"line_number":1602,"context_line":"    os.setuid(user[2])"},{"line_number":1603,"context_line":"    os.environ[\u0027HOME\u0027] \u003d user[5]"},{"line_number":1604,"context_line":"    if not no_setsid:"},{"line_number":1605,"context_line":"        try:"},{"line_number":1606,"context_line":"            os.setsid()"},{"line_number":1607,"context_line":"        except OSError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_9004354a","line":1604,"updated":"2015-05-20 19:57:54.000000000","message":"I\u0027ll just apologise now because double negatives jump out at me and this is minor. Why not set_sid\u003dTrue or something as the function arg here - I guess the desire is for callers to be more explicit?","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":1601,"context_line":"    os.setgid(user[3])"},{"line_number":1602,"context_line":"    os.setuid(user[2])"},{"line_number":1603,"context_line":"    os.environ[\u0027HOME\u0027] \u003d user[5]"},{"line_number":1604,"context_line":"    if not no_setsid:"},{"line_number":1605,"context_line":"        try:"},{"line_number":1606,"context_line":"            os.setsid()"},{"line_number":1607,"context_line":"        except OSError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_f3b1f3e0","line":1604,"in_reply_to":"7a016987_9004354a","updated":"2015-05-23 18:22:57.000000000","message":"I generally write for readability at the call-site, not the called function and it made sense for me to have default\n\n  drop_privileges(some_user)\n\ndo the old thing of calling setsid, but the new call-site do the clearly explicit-as-to-why-it\u0027s-different\n\n  drop_privileges(some_user, no_setsid\u003dTrue)\n\nbut I\u0027m not wedded to that, that\u0027s just the origin and rationale for the way it\u0027s written currently.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":1602,"context_line":"    os.setgid(user[3])"},{"line_number":1603,"context_line":"    os.setuid(user[2])"},{"line_number":1604,"context_line":"    os.environ[\u0027HOME\u0027] \u003d user[5]"},{"line_number":1605,"context_line":"    if not no_setsid:"},{"line_number":1606,"context_line":"        try:"},{"line_number":1607,"context_line":"            os.setsid()"},{"line_number":1608,"context_line":"        except OSError:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_07c9f1ab","line":1605,"updated":"2015-06-11 10:24:52.000000000","message":"I would prefer this was reworded to avoid the double negative.\n\nif not no?  and the default is False?  so... it\u0027s True!  (right?)","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":1602,"context_line":"    os.setgid(user[3])"},{"line_number":1603,"context_line":"    os.setuid(user[2])"},{"line_number":1604,"context_line":"    os.environ[\u0027HOME\u0027] \u003d user[5]"},{"line_number":1605,"context_line":"    if not no_setsid:"},{"line_number":1606,"context_line":"        try:"},{"line_number":1607,"context_line":"            os.setsid()"},{"line_number":1608,"context_line":"        except OSError:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1af86dd1_52230a06","line":1605,"in_reply_to":"3afb71cf_07c9f1ab","updated":"2015-06-12 00:25:06.000000000","message":"done.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"a6797bf75393c7c16229780b11deb813bca7c587","unresolved":false,"context_lines":[{"line_number":1712,"context_line":"    Get \"our\" IP addresses (\"us\" being the set of services configured by"},{"line_number":1713,"context_line":"    one *.conf file). If our REST listens on a specific address, return it."},{"line_number":1714,"context_line":"    Otherwise, if listen on \u00270.0.0.0\u0027 or \u0027::\u0027 return all addresses, including"},{"line_number":1715,"context_line":"    the loopback."},{"line_number":1716,"context_line":""},{"line_number":1717,"context_line":"    :returns: list of Strings of ip addresses"},{"line_number":1718,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_e0f3fe08","line":1715,"updated":"2015-06-15 19:05:19.000000000","message":"Add bind_ip to doc string params.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"}],"swift/common/wsgi.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":437,"context_line":"    pool.waitall()"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"# TODO(clayg): pull more pieces of this to test more"},{"line_number":441,"context_line":"def run_wsgi(conf_path, app_section, *args, **kwargs):"},{"line_number":442,"context_line":"    \"\"\""},{"line_number":443,"context_line":"    Runs the server using the specified number of workers."}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_2732ada7","line":440,"updated":"2015-06-11 10:24:52.000000000","message":"I tried to get rid of this comment in https://review.openstack.org/#/c/173622/","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d7d4a903b504e2f9cb150a1a88cbd8f6ebc2b8f","unresolved":false,"context_lines":[{"line_number":538,"context_line":"    def _bind_port(self, port):"},{"line_number":539,"context_line":"        new_conf \u003d self.conf.copy()"},{"line_number":540,"context_line":"        new_conf[\u0027bind_port\u0027] \u003d port"},{"line_number":541,"context_line":"        sock \u003d get_socket(new_conf)"},{"line_number":542,"context_line":"        self.sock_data_by_port[port] \u003d PortPidState(self.servers_per_port,"},{"line_number":543,"context_line":"                                                    port, sock)"},{"line_number":544,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af86dd1_4a9fb703","line":541,"updated":"2015-06-12 16:26:31.000000000","message":"So this can raise an uncaught exception\n\nJun 12 16:02:42 saio object-6016: UNCAUGHT EXCEPTION#012Traceback (most recent call last):#012  File \"/usr/local/bin/swift-object-server\", line 10, in \u003cmodule\u003e#012    execfile(__file__)#012  File \"/vagrant/swift/bin/swift-object-server\", line 27, in \u003cmodule\u003e#012    **options))#012  File \"/vagrant/swift/swift/common/wsgi.py\", line 706, in run_wsgi#012    for sock, sock_info in strategy.new_worker_socks():#012  File \"/vagrant/swift/swift/common/wsgi.py\", line 589, in new_worker_socks#012    self._bind_port(port)#012  File \"/vagrant/swift/swift/common/wsgi.py\", line 541, in _bind_port#012    sock \u003d get_socket(new_conf)#012  File \"/vagrant/swift/swift/common/wsgi.py\", line 200, in get_socket#012    bind_addr[0], bind_addr[1], bind_timeout))#012Exception: Could not bind to 127.0.0.1:11211 after trying for 30 seconds\n\nThe bummer part is that when it does that the parent process just dies without cleaning up the children and it\u0027s kind of a mess.","commit_id":"916eedbff72582f85fc971a4762c8bfcf366b8dd"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"632d084a36adbf0867791c3a6730fcd2d7e0c099","unresolved":false,"context_lines":[{"line_number":538,"context_line":"    def _bind_port(self, port):"},{"line_number":539,"context_line":"        new_conf \u003d self.conf.copy()"},{"line_number":540,"context_line":"        new_conf[\u0027bind_port\u0027] \u003d port"},{"line_number":541,"context_line":"        sock \u003d get_socket(new_conf)"},{"line_number":542,"context_line":"        self.sock_data_by_port[port] \u003d PortPidState(self.servers_per_port,"},{"line_number":543,"context_line":"                                                    port, sock)"},{"line_number":544,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af86dd1_64797f93","line":541,"in_reply_to":"1af86dd1_4a9fb703","updated":"2015-06-12 19:57:25.000000000","message":"I finally did it!","commit_id":"916eedbff72582f85fc971a4762c8bfcf366b8dd"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d7d4a903b504e2f9cb150a1a88cbd8f6ebc2b8f","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    error_msg \u003d strategy.bind_ports()"},{"line_number":665,"context_line":"    if error_msg:"},{"line_number":666,"context_line":"        logger.error(error_msg)"},{"line_number":667,"context_line":"        print(error_msg)"},{"line_number":668,"context_line":"        return 1"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    # Ensure the configuration and application can be loaded before proceeding."}],"source_content_type":"text/x-python","patch_set":15,"id":"1af86dd1_0a965f4c","line":667,"updated":"2015-06-12 16:26:31.000000000","message":"Hrmm... so I guess the WorkerStrategy at least can return the bind_port config option error message... but really the part I like about calling bind_ports here is that we get the \"Couldn\u0027t bind to ... after 30 seconds\" exception from get_socket to bubble out before we capture_stdio and swift-init drops the process to the background - so nice work.","commit_id":"916eedbff72582f85fc971a4762c8bfcf366b8dd"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"632d084a36adbf0867791c3a6730fcd2d7e0c099","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    error_msg \u003d strategy.bind_ports()"},{"line_number":665,"context_line":"    if error_msg:"},{"line_number":666,"context_line":"        logger.error(error_msg)"},{"line_number":667,"context_line":"        print(error_msg)"},{"line_number":668,"context_line":"        return 1"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    # Ensure the configuration and application can be loaded before proceeding."}],"source_content_type":"text/x-python","patch_set":15,"id":"1af86dd1_240ee734","line":667,"in_reply_to":"1af86dd1_0a965f4c","updated":"2015-06-12 19:57:25.000000000","message":"The message in WorkersStrategy only covers bad bind_port values and in ServersPerPortStrategy, the bind_port is set by the code there (not the user).  So I don\u0027t think there\u0027s anything missing here, even in the ideal world.","commit_id":"916eedbff72582f85fc971a4762c8bfcf366b8dd"},{"author":{"_account_id":7433,"name":"Richard Hawkins","email":"richard.hawkins@rackspace.com","username":"hurricanerix"},"change_message_id":"a6797bf75393c7c16229780b11deb813bca7c587","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    pool.waitall()"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"class WorkersStrategy(object):"},{"line_number":442,"context_line":"    def __init__(self, conf, logger):"},{"line_number":443,"context_line":"        self.conf \u003d conf"},{"line_number":444,"context_line":"        self.logger \u003d logger"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_00e142fe","line":441,"updated":"2015-06-15 19:05:19.000000000","message":"Add doc strings for class and methods.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"f0e9a78e1b68151105a75498880918248ee6c7ee","unresolved":false,"context_lines":[{"line_number":569,"context_line":"            self._reload_bind_ports(now)"},{"line_number":570,"context_line":"        desired_port_index_pairs \u003d set("},{"line_number":571,"context_line":"            (p, i) for p in self.bind_ports"},{"line_number":572,"context_line":"            for i in xrange(self.servers_per_port))"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"        current_port_index_pairs \u003d self._current_port_index_pairs()"},{"line_number":575,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_a86d1fce","line":572,"updated":"2015-06-14 02:50:49.000000000","message":"I\u0027m sorry, but I promised to -1 all instances of xrange, as a part of our transition to py3. In this case, I think, the number of servers_per_port is small enough to use plain range().","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":569,"context_line":"            self._reload_bind_ports(now)"},{"line_number":570,"context_line":"        desired_port_index_pairs \u003d set("},{"line_number":571,"context_line":"            (p, i) for p in self.bind_ports"},{"line_number":572,"context_line":"            for i in xrange(self.servers_per_port))"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"        current_port_index_pairs \u003d self._current_port_index_pairs()"},{"line_number":575,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_e083feca","line":572,"in_reply_to":"fa32b979_a86d1fce","updated":"2015-06-15 18:58:38.000000000","message":"I have a personal pet peeve against Python 2.x\u0027s \"range\"... why the hell would you ever want \"range\" instead of \"xrange\"? To save a letter when typing the code? Ridiculous!  It\u0027s not my fault Python made range inefficient and then added xrange.\n\nAnyway, I guess I\u0027ll spell it \"xrange\" here to avoid all the extra typing for some six-based \"xrange for all Pythons\"?","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"fb2e3f50321446c9ce1b59b76894f6a9e406dfa4","unresolved":false,"context_lines":[{"line_number":569,"context_line":"            self._reload_bind_ports(now)"},{"line_number":570,"context_line":"        desired_port_index_pairs \u003d set("},{"line_number":571,"context_line":"            (p, i) for p in self.bind_ports"},{"line_number":572,"context_line":"            for i in xrange(self.servers_per_port))"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"        current_port_index_pairs \u003d self._current_port_index_pairs()"},{"line_number":575,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_ceab8bd5","line":572,"in_reply_to":"fa32b979_e083feca","updated":"2015-06-15 19:33:55.000000000","message":"I think even with servers_per_port being 100, the overhead of using py2 range() here is negligeable. But you could add \"from six.moves import range\" if that\u0027s a problem.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"f0e9a78e1b68151105a75498880918248ee6c7ee","unresolved":false,"context_lines":[{"line_number":584,"context_line":"            # worker(s) but doesn\u0027t"},{"line_number":585,"context_line":"            missing_port_index_pairs \u003d desired_port_index_pairs - \\"},{"line_number":586,"context_line":"                current_port_index_pairs"},{"line_number":587,"context_line":"            for port, server_idx in sorted(missing_port_index_pairs):"},{"line_number":588,"context_line":"                if port not in self.sock_data_by_port:"},{"line_number":589,"context_line":"                    try:"},{"line_number":590,"context_line":"                        self._bind_port(port)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_b3a3449e","line":587,"updated":"2015-06-14 02:50:49.000000000","message":"not that it makes any difference, but why sort here?","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":584,"context_line":"            # worker(s) but doesn\u0027t"},{"line_number":585,"context_line":"            missing_port_index_pairs \u003d desired_port_index_pairs - \\"},{"line_number":586,"context_line":"                current_port_index_pairs"},{"line_number":587,"context_line":"            for port, server_idx in sorted(missing_port_index_pairs):"},{"line_number":588,"context_line":"                if port not in self.sock_data_by_port:"},{"line_number":589,"context_line":"                    try:"},{"line_number":590,"context_line":"                        self._bind_port(port)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_80eeb2b2","line":587,"in_reply_to":"fa32b979_b3a3449e","updated":"2015-06-15 18:58:38.000000000","message":"Usually this sort of thing (haha! get it? this sort of thing??) is to have a stable ordering not dependent on hashing for testability, but I don\u0027t remember if that\u0027s true here or not.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"f0e9a78e1b68151105a75498880918248ee6c7ee","unresolved":false,"context_lines":[{"line_number":629,"context_line":"        dead_port, server_idx \u003d port_server_idx"},{"line_number":630,"context_line":"        self.logger.error(\u0027Removing dead child %d (PID: %s) for port %s\u0027,"},{"line_number":631,"context_line":"                          server_idx, pid, dead_port)"},{"line_number":632,"context_line":"        self.sock_data_by_port[dead_port].pids[server_idx] \u003d None"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def shutdown_sockets(self):"},{"line_number":635,"context_line":"        for sock_data in self.sock_data_by_port.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_d3ffe832","line":632,"updated":"2015-06-14 02:50:49.000000000","message":"no rem_pid() huh :-)\n\n(I think the add_pid() is useless obfuscation above, because the core reason to use an indexed array is because the concept of this \"matrix\" of port-x-pids is pervasive -- whichi is why this one above just indexes and plops None in.)","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":629,"context_line":"        dead_port, server_idx \u003d port_server_idx"},{"line_number":630,"context_line":"        self.logger.error(\u0027Removing dead child %d (PID: %s) for port %s\u0027,"},{"line_number":631,"context_line":"                          server_idx, pid, dead_port)"},{"line_number":632,"context_line":"        self.sock_data_by_port[dead_port].pids[server_idx] \u003d None"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def shutdown_sockets(self):"},{"line_number":635,"context_line":"        for sock_data in self.sock_data_by_port.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_40e18acf","line":632,"in_reply_to":"fa32b979_d3ffe832","updated":"2015-06-15 18:58:38.000000000","message":"Good point!  I\u0027ll see if full encapsulation reads better, or get rid of add_pid().","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"4008ba8c9619bb5fe2554f87fa830c293393a495","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        print(e)"},{"line_number":657,"context_line":"        return 1"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    # NOTE: for now servers_per_port is object-server-only; future work could"},{"line_number":662,"context_line":"    # be done to test and allow it to be used for account and container"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_e4e4923c","line":659,"updated":"2015-06-15 11:10:11.000000000","message":"if servers_per_port is NOT set, int(\u00270\u0027) will go to 0 so that I think \u0027or 0\u0027 at the tail is unnecessary.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"6bbfd980900f7e1c383673acb49fc3300e1d6c99","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        print(e)"},{"line_number":657,"context_line":"        return 1"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    # NOTE: for now servers_per_port is object-server-only; future work could"},{"line_number":662,"context_line":"    # be done to test and allow it to be used for account and container"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_e9e8c97e","line":659,"in_reply_to":"fa32b979_0e2ad32c","updated":"2015-06-15 20:08:24.000000000","message":"No, I\u0027m pretty sure\n\n  servers_per_port \u003d\n\nresulted in a non-None value (the empty string) for the key \"servers_per_port\" and the int(\u0027\u0027) raised ValueError.\n\nI hit that in testing, when other code of mine generated a config with\n\n  servers_per_port \u003d\n\ninstead of either\n\n  servers_per_port \u003d 0\n\nor just no line at all.  I was just trying to be nice to deployers...","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"9d3f125514aba518041cd3ed285721a69d529d99","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        print(e)"},{"line_number":657,"context_line":"        return 1"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    # NOTE: for now servers_per_port is object-server-only; future work could"},{"line_number":662,"context_line":"    # be done to test and allow it to be used for account and container"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_445bb087","line":659,"in_reply_to":"fa32b979_286301de","updated":"2015-06-16 15:30:00.000000000","message":"config_auto_int_value() doesn\u0027t make sense here because \"auto\" really means \"enable with a runtime-determined default value\", and that\u0027s not what would happen here (I\u0027m not adding code to try to determine a dynamic config value at runtime).\n\nWhat\u0027s really happening is a boolean config setting and an integer config setting are being rolled into one (mostly because people are always complaining about how many config settings Swift has, and \"Oh my god, we\u0027re adding another config setting!\", etc. etc.).\n\nMaybe a try/except with just int parsing with boolean parsing inside the except block?  Or, heaven help us, a new swift.common.utils.config_boolean_int_value() function?","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"fb2e3f50321446c9ce1b59b76894f6a9e406dfa4","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        print(e)"},{"line_number":657,"context_line":"        return 1"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    # NOTE: for now servers_per_port is object-server-only; future work could"},{"line_number":662,"context_line":"    # be done to test and allow it to be used for account and container"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_0e2ad32c","line":659,"in_reply_to":"fa32b979_80a9d27d","updated":"2015-06-15 19:33:55.000000000","message":"In other words, the only difference with \"or 0\" and without is the case when \u0027servers_per_port\u0027 key is present in conf, but the value is None. In that case, the default argument of .get() is not used, None floats through to int(), and a TypeError occurs. I\u0027m unclear if bare servers_per_port\u003d with no value ends with such result, but might as well guard... Except that if a user writes a non-integer string there (like \u0027auto\u0027), it\u0027s the same exception again.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        print(e)"},{"line_number":657,"context_line":"        return 1"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    # NOTE: for now servers_per_port is object-server-only; future work could"},{"line_number":662,"context_line":"    # be done to test and allow it to be used for account and container"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_80a9d27d","line":659,"in_reply_to":"fa32b979_e4e4923c","updated":"2015-06-15 18:58:38.000000000","message":"this makes\n\n  servers_per_port \u003d\n\nequivalent to \"not in config file\" and\n\n  servers_per_port \u003d 0","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"78b177ab28aaa9a6532d2f12b67a50099ee1bdef","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        print(e)"},{"line_number":657,"context_line":"        return 1"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    # NOTE: for now servers_per_port is object-server-only; future work could"},{"line_number":662,"context_line":"    # be done to test and allow it to be used for account and container"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_286301de","line":659,"in_reply_to":"fa32b979_e9e8c97e","updated":"2015-06-16 01:47:12.000000000","message":"It makes me sense ValueError will occur when *the key is set* but *value is empty string. So to make well guard, I\u0027d prefer to use something like swift.common.utils.config_auto_into_value as Pete suggested though, for now, it will raise an Error when the value is empty string.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"4008ba8c9619bb5fe2554f87fa830c293393a495","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        # The strategy may need to pay attention to something in addition to"},{"line_number":725,"context_line":"        # child process exits (like ring file mtime changes).  So we only wait"},{"line_number":726,"context_line":"        # a bit for exiting children before looping through again."},{"line_number":727,"context_line":"        with Timeout(0.5, exception\u003dFalse):"},{"line_number":728,"context_line":"            try:"},{"line_number":729,"context_line":"                pid, status \u003d green_os.wait()"},{"line_number":730,"context_line":"                if os.WIFEXITED(status) or os.WIFSIGNALED(status):"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_27e59c08","line":727,"updated":"2015-06-15 11:10:11.000000000","message":"Assuming this Timeout is needed for rechecking the orphaned (or missing) port according to current ring so, I guess, ring_check_interval seems enough for the timeout secs because during the interval the loaded ring will not be changed.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        # The strategy may need to pay attention to something in addition to"},{"line_number":725,"context_line":"        # child process exits (like ring file mtime changes).  So we only wait"},{"line_number":726,"context_line":"        # a bit for exiting children before looping through again."},{"line_number":727,"context_line":"        with Timeout(0.5, exception\u003dFalse):"},{"line_number":728,"context_line":"            try:"},{"line_number":729,"context_line":"                pid, status \u003d green_os.wait()"},{"line_number":730,"context_line":"                if os.WIFEXITED(status) or os.WIFSIGNALED(status):"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_6077ee3a","line":727,"in_reply_to":"fa32b979_27e59c08","updated":"2015-06-15 18:58:38.000000000","message":"Good point! I\u0027ll move the timeout value calculation into the strategy, where it belongs.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"cc809da83dfc4b187954db75f5b2bacfaad618f3","unresolved":false,"context_lines":[{"line_number":559,"context_line":""},{"line_number":560,"context_line":"    :param int servers_per_port: The configured number of servers per port."},{"line_number":561,"context_line":"    :param logger: The server\u0027s :py:class:`~swift.common.utils.LogAdaptor`"},{"line_number":562,"context_line":"    \"\"\""},{"line_number":563,"context_line":""},{"line_number":564,"context_line":"    def __init__(self, servers_per_port, logger):"},{"line_number":565,"context_line":"        self.servers_per_port \u003d servers_per_port"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_40d46dea","line":562,"updated":"2015-06-19 07:57:48.000000000","message":"nit: This class got more complicated since patch set 16 - but I don\u0027t think it\u0027s doing anything more complex.","commit_id":"df134df901a13c2261a8205826ea1aa8d75dc283"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"cc809da83dfc4b187954db75f5b2bacfaad618f3","unresolved":false,"context_lines":[{"line_number":763,"context_line":""},{"line_number":764,"context_line":"        current_port_index_pairs \u003d self.port_pid_state.port_index_pairs()"},{"line_number":765,"context_line":""},{"line_number":766,"context_line":"        if desired_port_index_pairs !\u003d current_port_index_pairs:"},{"line_number":767,"context_line":"            # Orphan ports are ports which had object-server processes running,"},{"line_number":768,"context_line":"            # but which no longer appear in the ring.  We\u0027ll kill them after we"},{"line_number":769,"context_line":"            # start missing workers."}],"source_content_type":"text/x-python","patch_set":19,"id":"fa32b979_00f18594","line":766,"updated":"2015-06-19 07:57:48.000000000","message":"nit: the coupling of these two data structures - but the fact they\u0027re build in two different places by two different classes kinda smells a little bit","commit_id":"df134df901a13c2261a8205826ea1aa8d75dc283"}],"swift/obj/reconstructor.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"966ebbd18416047ced1e203188c0eba0332894e0","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        self.mount_check \u003d config_true_value(conf.get(\u0027mount_check\u0027, \u0027true\u0027))"},{"line_number":121,"context_line":"        self.swift_dir \u003d conf.get(\u0027swift_dir\u0027, \u0027/etc/swift\u0027)"},{"line_number":122,"context_line":"        self.bind_ip \u003d conf.get(\u0027bind_ip\u0027, \u00270.0.0.0\u0027)"},{"line_number":123,"context_line":"        self.servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":124,"context_line":"        self.port \u003d None if self.servers_per_port else \\"},{"line_number":125,"context_line":"            int(conf.get(\u0027bind_port\u0027, 6000))"},{"line_number":126,"context_line":"        self.concurrency \u003d int(conf.get(\u0027concurrency\u0027, 1))"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_e7b5b5ec","line":123,"updated":"2015-06-11 10:24:52.000000000","message":"What\u0027s the different in how this pulls integers from the config and how say... bind_port does it?  Like... empty string?","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f7a1cc253703d8ad69ce4f491841457c045d6bc0","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        self.mount_check \u003d config_true_value(conf.get(\u0027mount_check\u0027, \u0027true\u0027))"},{"line_number":121,"context_line":"        self.swift_dir \u003d conf.get(\u0027swift_dir\u0027, \u0027/etc/swift\u0027)"},{"line_number":122,"context_line":"        self.bind_ip \u003d conf.get(\u0027bind_ip\u0027, \u00270.0.0.0\u0027)"},{"line_number":123,"context_line":"        self.servers_per_port \u003d int(conf.get(\u0027servers_per_port\u0027, \u00270\u0027) or 0)"},{"line_number":124,"context_line":"        self.port \u003d None if self.servers_per_port else \\"},{"line_number":125,"context_line":"            int(conf.get(\u0027bind_port\u0027, 6000))"},{"line_number":126,"context_line":"        self.concurrency \u003d int(conf.get(\u0027concurrency\u0027, 1))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1af86dd1_324e4ec2","line":123,"in_reply_to":"3afb71cf_e7b5b5ec","updated":"2015-06-12 00:25:06.000000000","message":"The difference is that there was a brief period where my SwiftStack code branch erroneously wrote\n\n  servers_per_port \u003d\n\nwhen the feature was disabled.  I\u0027ve changed that, but I decided that being robust to that and treating it as though it were 0 (and thus disabled) was better.","commit_id":"e8af582ae0e00553fcb888a0494b6ee117eb5606"}],"test/probe/common.py":[{"author":{"_account_id":5600,"name":"Brian Cline","email":"bcline@softlayer.com","username":"briancline"},"change_message_id":"4307a185a33a53be15d812ada22c197a4956e1cf","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    store_config_paths(server, config_paths)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    repl_name \u003d \u0027%s-replicator\u0027 % server"},{"line_number":182,"context_line":"    repl_configs \u003d {i: readconf(c, section_name\u003drepl_name)"},{"line_number":183,"context_line":"                    for i, c in config_paths[repl_name].iteritems()}"},{"line_number":184,"context_line":"    server_per_port \u003d any(config_true_value(c.get(\u0027server_per_port\u0027, \u0027no\u0027))"},{"line_number":185,"context_line":"                          for c in repl_configs.values())"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_0b84965b","line":182,"updated":"2015-05-20 19:57:54.000000000","message":"Since this might make a difference here - is Python 2.6 or 2.7 the current minimum requirement for Swift?","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"5c1d7bb0d50e1f199f437e6173d09cf6c96f6e0f","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    store_config_paths(server, config_paths)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    repl_name \u003d \u0027%s-replicator\u0027 % server"},{"line_number":182,"context_line":"    repl_configs \u003d {i: readconf(c, section_name\u003drepl_name)"},{"line_number":183,"context_line":"                    for i, c in config_paths[repl_name].iteritems()}"},{"line_number":184,"context_line":"    server_per_port \u003d any(config_true_value(c.get(\u0027server_per_port\u0027, \u0027no\u0027))"},{"line_number":185,"context_line":"                          for c in repl_configs.values())"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_53b9e7ca","line":182,"in_reply_to":"7a016987_0b84965b","updated":"2015-05-23 18:22:57.000000000","message":"Good point, I\u0027ll rewrite that w/o the dict comprehension.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"e04a8f3c28f85b88c3eff97f123e5bc9a63ba0b1","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    store_config_paths(server, config_paths)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    repl_name \u003d \u0027%s-replicator\u0027 % server"},{"line_number":182,"context_line":"    repl_configs \u003d {i: readconf(c, section_name\u003drepl_name)"},{"line_number":183,"context_line":"                    for i, c in config_paths[repl_name].iteritems()}"},{"line_number":184,"context_line":"    server_per_port \u003d any(config_true_value(c.get(\u0027server_per_port\u0027, \u0027no\u0027))"},{"line_number":185,"context_line":"                          for c in repl_configs.values())"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_edded9d8","line":182,"in_reply_to":"7a016987_53b9e7ca","updated":"2015-05-30 22:51:07.000000000","message":"Actually, pretty sure Python 2.6 has been /dropped/ as an officially supported version of Python for Swift and the gate no longer runs tox py26.","commit_id":"285c2d34f6fe399151225af3a1a733a1cab33485"}],"test/unit/common/test_storage_policy.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d7d4a903b504e2f9cb150a1a88cbd8f6ebc2b8f","unresolved":false,"context_lines":[{"line_number":776,"context_line":"                 \u0027port\u0027: 6010},  # on our IP and a not-us IP"},{"line_number":777,"context_line":"                {\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 1, \u0027ip\u0027: other_ips[0],"},{"line_number":778,"context_line":"                 \u0027port\u0027: 6013},"},{"line_number":779,"context_line":"                None,"},{"line_number":780,"context_line":"                {\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 1, \u0027ip\u0027: my_ips[1],"},{"line_number":781,"context_line":"                 \u0027port\u0027: 6014},"},{"line_number":782,"context_line":"                {\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 1, \u0027ip\u0027: other_ips[1],"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af86dd1_ea22e3b8","line":779,"updated":"2015-06-12 16:26:31.000000000","message":"nice, sparse dev list - good call","commit_id":"916eedbff72582f85fc971a4762c8bfcf366b8dd"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"632d084a36adbf0867791c3a6730fcd2d7e0c099","unresolved":false,"context_lines":[{"line_number":776,"context_line":"                 \u0027port\u0027: 6010},  # on our IP and a not-us IP"},{"line_number":777,"context_line":"                {\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 1, \u0027ip\u0027: other_ips[0],"},{"line_number":778,"context_line":"                 \u0027port\u0027: 6013},"},{"line_number":779,"context_line":"                None,"},{"line_number":780,"context_line":"                {\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 1, \u0027ip\u0027: my_ips[1],"},{"line_number":781,"context_line":"                 \u0027port\u0027: 6014},"},{"line_number":782,"context_line":"                {\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 1, \u0027ip\u0027: other_ips[1],"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af86dd1_2425c7aa","line":779,"in_reply_to":"1af86dd1_ea22e3b8","updated":"2015-06-12 19:57:25.000000000","message":"Yup... caught that bug in functional testing, then came back and beefed up the test \u0026 fixed the code.","commit_id":"916eedbff72582f85fc971a4762c8bfcf366b8dd"}],"test/unit/obj/test_replicator.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"4008ba8c9619bb5fe2554f87fa830c293393a495","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def _ips(*args, **kwargs):"},{"line_number":40,"context_line":"    return [\u0027127.0.0.0\u0027]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def mock_http_connect(status):"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_7b1d7c72","line":40,"updated":"2015-06-15 11:10:11.000000000","message":"It might be just only my idea but we might not need _ips anymore for maintainability with either just set \u0027127.0.0.0\u0027 instead of _ips()[0] or mock.patch(\u0027swift.obj.replicator.whataremyips\u0027, return_value\u003d\u0027127.0.0\u0027). (though we might keep \u0027127.0.0.0\u0027 for a fixed value)","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"78b177ab28aaa9a6532d2f12b67a50099ee1bdef","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def _ips(*args, **kwargs):"},{"line_number":40,"context_line":"    return [\u0027127.0.0.0\u0027]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def mock_http_connect(status):"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_08eddd24","line":40,"in_reply_to":"fa32b979_40998a1e","updated":"2015-06-16 01:47:12.000000000","message":"Ok, no problem :)","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"94b9649195701d409b00bb7248f027e2ba5e4c82","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def _ips(*args, **kwargs):"},{"line_number":40,"context_line":"    return [\u0027127.0.0.0\u0027]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def mock_http_connect(status):"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa32b979_40998a1e","line":40,"in_reply_to":"fa32b979_7b1d7c72","updated":"2015-06-15 18:58:38.000000000","message":"Maybe.  I think that clean-up is orthogonal to my patch, and I was happy to defer it.","commit_id":"efc494638445a899ee7ee83fdf8d2442ece502e2"}]}
