英文:
Python program exits forcibly after subscribing to a streaming table in DolphinDB and adding data to the table
问题
一个Python程序在DolphinDB中的一个线程中订阅了一个流表singalTable,然后尝试使用tableInsert
将数据插入表中。然而,当调用该函数时,Python程序崩溃并退出。
DolphinDB的最后一个日志如下:
有人知道问题出在哪里吗?
英文:
A Python program subscribes to a streaming table singalTable in a thread in DolphinDB and then attempts to insert data into the table using tableInsert
. However, when the function is called, the Python program crashes and exits.
The last log of DolphinDB is as follows:
Does anyone know where the problem is?
答案1
得分: 1
"IO_ERROR 1"日志中的消息表明API已关闭连接。要解决此问题,需要检查两个事项:
-
检查服务器和API版本是否兼容:在升级到版本2.00.9或更高版本后,要接收来自DolphinDB服务器的最新流数据,需要确保Python SDK也升级到相应版本。
-
检查是否在写入数据和订阅流表时使用了相同的连接会话:会话不是线程安全的,这种行为可能会导致连接关闭等问题。因此,需要为这两个任务使用不同的会话。
英文:
The IO_ERROR 1
message in the log indicates that the API has closed the connection. To solve this problem, two things need to be checked:
- Check whether the server and API versions are compatible: To receive
latest streaming data from the DolphinDB server after upgrading to
version 2.00.9 or later, you need to make sure that the Python SDK
is also upgraded to the corresponding version. - Check whether the same connection session is being used for writing
data to and subscribing to the streaming table: Sessions are not
thread-safe and this behaviour can lead to issues such as connection
closure. So different sessions are needed for the two tasks.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论