Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robyn crashing on use with LanceDB #824

Open
sansyrox opened this issue May 28, 2024 · 2 comments
Open

Robyn crashing on use with LanceDB #824

sansyrox opened this issue May 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sansyrox
Copy link
Member

sansyrox commented May 28, 2024

Bug Description

Error message

 objc[30548]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[30548]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. 

Works properly when you do

OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES python3 filename.py

Steps to Reproduce

import chromadb
import lancedb

from robyn import Response, Robyn, jsonify, Request
from langchain.vectorstores import LanceDB

# from langchain.documents import Document




app = Robyn(__file__)



db = lancedb.connect("./.lancedb_test")
data = [{"vector": [1.1, 1.2], "lat": 45.5, "long": -122.7}, {"vector": [0.2, 1.8], "lat": 40.1, "long":  -74.1}]



@app.get("/")
def home():
    # print("This is the new table", db.open_table("my_table_new") )

    data = [
        {"vector": [3.1, 4.1], "item": "foo", "price": 10.0},
        {"vector": [5.9, 26.5], "item": "bar", "price": 20.0},
    ]

# Synchronous client
    tbl = db.open_table("my_table2")
    tbl.add(data)
    return {
        "sucecss": True
    }

if __name__ == "__main__":
    app.start()


Your operating system

Mac OS

Your Python version (python --version)

3.10

Your Robyn version

0.54.5

Additional Info

No response

@sansyrox sansyrox added the bug Something isn't working label May 28, 2024
@wjones127
Copy link

Hi from LanceDB. We unfortunately don't support multiprocessing with fork(). If possible, you should use spawn instead. More detail here: lancedb/lance#2204 (comment)

@sansyrox
Copy link
Member Author

sansyrox commented Jun 1, 2024

Hey @wjones127 👋

Thanks for letting me know. Unfortunately, robyn doesn't work properly with spawn instead of fork. Let me try and address that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants