r4fek / django-cassandra-engine

Django Cassandra Engine - the Cassandra backend for Django
BSD 2-Clause "Simplified" License
365 stars 85 forks source link

Segmentation fault #35

Closed Sparkh closed 9 years ago

Sparkh commented 9 years ago

I'm on mac OSX Yosemite v10.10.3. Virtual env:

blist (1.3.6)
cassandra-driver (2.5.1)
Django (1.8.2)
django-cassandra-engine (0.3.2)
futures (3.0.2)
pip (6.1.1)
setuptools (12.0.5)
six (1.9.0)

Apps:

INSTALLED_APPS = (
    'django_cassandra_engine',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'my_app',
)

Database:

DATABASES = {
    'default': {
        'ENGINE': 'django_cassandra_engine',
        'NAME': 'akeyspace',
        'HOST': '***.***.***.***',
        'OPTIONS': {
            'replication': {
                'strategy_class': 'SimpleStrategy',
                'replication_factor': 1
            }
        }
    }
}

The host is not a localhost cassandra server. Command used:

./manage.py sync_cassandra
./manage.py runserver

When the server is running, make some changes in my models, save the changes and refresh my web page, sometimes I get a segmentation fault. No matter how many changes I'm doing, it can be just 2 or many others at the end I segfault

Sparkh commented 9 years ago

I added this:

'connection': {
                'consistency': ConsistencyLevel.ONE,
                'retry_connect': True
                # + All connection options for cassandra.cluster.Cluster()
            },
            'session': {
                'default_timeout': 10,
                'default_fetch_size': 10000
                # + All options for cassandra.cluster.Session()
            }

to DATABASE. And it seems to works well without any Segfault (after many changes and saves no segfault appears)

EDIT: finally no... Segfault again (same manipulation)

Sparkh commented 9 years ago

If it can help you: https://gist.github.com/Sparkh/7e20bc247a3aa0cdb2bb

Sparkh commented 9 years ago

Are you sure you don't make some mess with something when the server is reloading ? With a normal django + djangorestframework app I have nothing but with django-cassandra-engine when the server is reloaded, it give me a segmentation fault...

Some MAC OSX user who have the same issue ?

r4fek commented 9 years ago

I'm using it on Mac without any problems.

Sparkh commented 9 years ago

Are you using brew ?

r4fek commented 9 years ago

No, macports.

Sparkh commented 9 years ago

Ok so it was brew.. I installed macports and re-install all my packages and now it works without any segfault. Thanks for the quick response and I'm really sorry for the inconveniences.