pyorient: infinite loop when connecting to orientdb that's running in distributed mode
I’m using orientDB v.2.2.7 on AWS in distributed mode.
When connecting using pyorient 1.5.4, the connection freeze up. Inside the OrientSerializationCSV class, on the “_parse_collection” method, the while loop goes into an infinite loop.
It looks like “_parse_set(self, content)” can’t really handle unexpected formatting. It seems very unreliable. If “_parse_value” returns the same content as what was passed into it, as per the last “else” statement, the entire “_parse_set” method ends up in an infinite loop.
From my tests, it looks like “_parse_set” is only called when connecting to a distributed database. In my case, the code tries to parse the following string:
<"MyDatabase">,
usedMemory: 143389672l,
freeMemory: 375589912l,
maxMemory: 518979584l,
latencies: (node-0AbxA4VVo9PcEmOC: (entries: 200l,
last: 788930l,
min: 0l,
max: 788930l,
average: 788930.0f,
total: 788930l,
firstExecution: 1473174585720l,
lastExecution: 1473176590139l,
lastReset: 1473176590139l,
lastResetEntries: 1l)),
messages: (heartbeat: 199l,
deploy_db: 1l)),
(id: 0,
uuid: "6c9ab948-547d-4e91-b2a2-0e8381d91f0e",
name: "node-0AbxA4VVo9PcEmOC",
startedOn: 1473174542365t,
status: "ONLINE",
connections: 2,
listeners: [
{
"protocol": "ONetworkProtocolBinary",
"listen": "127.11.11.11:2424"
},
{
"protocol": "ONetworkProtocolHttpDb",
"listen": "127.11.11.11:2480"
}
],
user_replicator: "4047485640755908123",
databases: <"MyDatabase">,
usedMemory: 145392192l,
freeMemory: 373587392l,
maxMemory: 518979584l,
latencies: (node7096-5453: (entries: 200l,
last: 815985l,
min: 0l,
max: 1488559l,
average: 983307.0f,
total: 3933231l,
firstExecution: 1473174604530l,
lastExecution: 1473176594562l,
lastReset: 1473176564562l,
lastResetEntries: 4l)),
messages: (heartbeat: 200l))
],
database: (autoDeploy: true,
hotAlignment: false,
executionMode: "asynchronous",
readQuorum: 1,
writeQuorum: 2,
failureAvailableNodesLessQuorum: false,
readYourWrites: true,
servers: (*: "master"),
clusters: (internal: (),
index: (),
*: (servers: [
"node-0AbxA4VVo9PcEmOC",
"node7096-5453",
"<NEW_NODE>"
]),
posts_base_35: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_24: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_34: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_23: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_6: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_33: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_7: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
posts_base_10: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
---------------------------------
Keeps going for each cluster
---------------------------------
post_9: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
]),
post_26: (servers: [
"node7096-5453",
"node-0AbxA4VVo9PcEmOC",
"<NEW_NODE>"
])),
version: 410)
“_parse_set” is not able to parse that set of values and results in the connection locking up. Could we not use another deserializer instead?
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 2
- Comments: 15 (3 by maintainers)
@anber500 ok now it’s merged in the develop branch. Yes I know it’s confusing we have to clean up all the messy with forks and the likes, we are chatting with people from OrientDB too to understand how to do it It will be better I promis 😄