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

"too much recursion" in mergeTree #1786

Closed
shimaore opened this issue Apr 1, 2014 · 13 comments
Closed

"too much recursion" in mergeTree #1786

shimaore opened this issue Apr 1, 2014 · 13 comments

Comments

@shimaore
Copy link
Contributor

shimaore commented Apr 1, 2014

More precisely at line 65:

    tree1[2].sort();

This is using the git version of PouchDB.

@calvinmetcalf
Copy link
Member

ugh, I thought we had solved that one

@calvinmetcalf
Copy link
Member

or not this seems to be something else as mergeTree doesn't seem to call any other functions, what browser/platform is this

@shimaore
Copy link
Contributor Author

shimaore commented Apr 1, 2014

@calvinmetcalf yup, I had looked at the previous "too much recursion" bug and this looked like a new issue.
This is on Firefox (Iceweasel) 27.0.1, Debian/Linux amd64. This seems to happen pretty early, after the CORS OPTIONS but before initial GET (/database) completes.

@calvinmetcalf
Copy link
Member

what is the call stack when it happens ?

@tamasmajor
Copy link

pouchdb-2.0.0
breakpoint in line [4986] tree1[2].sort()
I can continue 5-6 times then 'too much recursion'
Stack from the last successful continue if it help:

mergeTree()pouchdb-2.0.0.js (line 4986)
in_tree1 = ["b6a17eac960ecc09aaf79d17cc1dc966", Object { status="missing"}, [["76feb85855820b6b1fef7be27c074dad", Object { status="missing"},
... ~25 more missing object ...
[["349fec0075daf5f9d06366450e2509e3", Object { status="missing"}, [["13214247385ab67cc0da3c0f8fe1fea3", [unsupported: no toString() function in type object] {}, ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
in_tree2 = ["b6a17eac960ecc09aaf79d17cc1dc966", Object { status="missing"}, [["76feb85855820b6b1fef7be27c074dad", Object { status="missing"},
... ~25 more missing object ...
[["13214247385ab67cc0da3c0f8fe1fea3", Object { status="missing"}, [["b2d1d045b60b2f3526b1df6972cfd8a7", Object {}, []]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

(?)()pouchdb-2.0.0.js (line 5007)
branch = Object { pos=1, ids=[3]}

doMerge()pouchdb-2.0.0.js (line 5003)
tree = [Object { pos=1, ids=[3]}]
path = Object { pos=1, ids=[3]}
dontExpand = true
(?)()pouchdb-2.0.0.js (line 5087)
prev = [Object { pos=1, ids=[3]}]
current = Object { pos=1, ids=[3]}
i = 2
arr = [Object { pos=1, ids=[3]}, Object { pos=1, ids=[3]}, Object { pos=1, ids=[3]}, 6 more...]
stem()pouchdb-2.0.0.js (line 5088)
tree = [Object { pos=1, ids=[3]}, Object { pos=1, ids=[3]}]
depth = 1000

merge()pouchdb-2.0.0.js (line 5099)
tree = [Object { pos=1, ids=[3]}, Object { pos=197, ids=[3]}]
path = Object { pos=1, ids=[3]}
depth = 1000

updateDoc()pouchdb-2.0.0.js (line 2301)
oldDoc = Object { deletedOrLocal="0", id="F8206D51-F666-41C0-AFF7-610526AC3431", rev_tree=[2], more...}
docInfo = Object { metadata={...}, data={...}, _bulk_seq=0}

onsuccess()pouchdb-2.0.0.js (line 2132)
event = success

@calvinmetcalf
Copy link
Member

do you still get this with version 2.1.0?

@tamasmajor
Copy link

No, but I get a different one.
details
[Object { status=500, error=true, reason="Unknown reason"}, undefined, undefined]
0
Object { status=500, error=true, reason="Unknown reason"}
error
"Replication aborted"
reason
"target.bulkDocs failed to write docs"
status
500

@tamasmajor
Copy link

With version 2.1.0 I get the same error message for every db in the complete function after the pull finished. Firefox, Chrome, Chome in incognito mode.

EDIT:
Replication is working with a newly created CouchDB, but not working with the old ones.

@calvinmetcalf
Copy link
Member

hm now we're geting somewhere, stack trace on that ?

@tamasmajor
Copy link

The error object is null in the complete function [5529]
Breakpoint on the return; in processPendingBatch() [5471]
processPendingBatch()pouchdb-2.1.0.js (line 5471)
complete()pouchdb-2.1.0.js (line 5534)
err = null
changes = Object { results=[40], last_seq=141}
once()pouchdb-2.1.0.js (line 6309)
args = [null, Object { results=[40], last_seq=141}]
getArguments()pouchdb-2.1.0.js (line 5991)
(?)()pouchdb-2.1.0.js (line 6398)
result = Object { results=[40], last_seq=141}
unwrap()pouchdb-2.1.0.js (line 7086)
drainQueue()pouchdb-2.1.0.js (line 7120)

@nolanlawson
Copy link
Member

@shimaore @tamasmajor Is this still happening in 3.3.1? I'm seeing a lot of people landing on this page from Google, so I'm guessing it's not fixed. But without a live reproducible test case, it's really tough to debug. :(

@shimaore
Copy link
Contributor Author

shimaore commented Mar 3, 2015

@nolanlawson no idea :( I think I had the issue with https://github.com/shimaore/pouchdb-calendar at the time but that project is way out-of-date wrt PouchDB.

@daleharvey
Copy link
Member

Consolidating on one issue - #3225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants