Ask Your Question

Mr Jo's profile - activity

2018-07-16 04:34:22 -0500 received badge  Famous Question (source)
2016-10-17 08:38:30 -0500 received badge  Student (source)
2016-09-13 06:41:53 -0500 received badge  Popular Question (source)
2016-09-13 06:41:53 -0500 received badge  Notable Question (source)
2016-02-16 06:31:48 -0500 received badge  Popular Question (source)
2016-02-11 04:41:16 -0500 asked a question Versions compatibility matrix for Swift

I would like to upgrade my storage nodes without upgrading the whole system. For instance, https://swiftstack.com/blog/2013/12/20/upgrade-openstack-swift-no-downtime/ (this post) describe how to proceed, but does not mention any compatibility version warning. However, I wonder : may I have a 2.5 proxy server & account nodes with 2.6 container & storage nodes ?

More widely, I'm looking for a versions compatibility matrix for Swift stack nodes.

2016-02-06 06:34:52 -0500 asked a question Swift middleware vs. multithreading

I would like to launch some async process in a swift proxy server middleware. At the moment, the 'process' does nothing (it simply waits for 5 seconds time.sleep(5)).

I tried two ways:

  • First try: my process is defined in a class extending multithreading.Thread class, and starts in each __call__ of my middleware
  • Second try: use of swift.common.utils.GreenAsyncPile, initialized in the __init__ function of my middleware, then use of spawn in middleware __call__ function.

The first try works with swift 2.5.0 (swift all in one, ubuntu server 14.04). With swift 2.6.0, as soon as the process starts, every request sent to swift during the process execution remains pending up to the end of the process, even if my process is well started in an async way (I can see a log immediately after a thread start call).

The second try behaves in same way in swift 2.5.0 & 2.6.0 (blocking call).

I've tried with multiple values for swift proxy server number of workers and size of the thread pool, without success.

I wonder :

  • Did I do it the wrong way ? I did not find doc or sample for doing this.
  • Is there any other way to define async behavior in a swift middleware ?

My middleware looks like:

import DummyTask
import DummyThread
from swift.common.utils import GreenAsyncPile

class DummyMiddleware(object):

    def __init__(self, app, conf=None):
        self.app = app
        self.pool = GreenAsyncPile(10)

    def __call__(self, env, start_response):
        t = DummyThread()
        t.daemon = True
        t.start()
        # or blocking call : self.pool.spawn(DummyTask().run)
        return self.app(env, start_response)
def filter_factory(global_config, **local_config):
    conf = global_config.copy()
    conf.update(local_config)

    def factory(app):
        return DummyMiddleware(app, conf)
    return factory

My task looks like:

import time
class DummyTask(object):

def run(self):
    time.sleep(5)

My thread looks like:

import time
from threading import Thread
class DummyThread(Thread):

    def __init__(self):
        Thread.__init__(self)

    def run(self):
       time.sleep(5)