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

"Diamond" joins can cause bad deleting errors. #7

Open
tmeasday opened this issue May 29, 2013 · 8 comments
Open

"Diamond" joins can cause bad deleting errors. #7

tmeasday opened this issue May 29, 2013 · 8 comments
Labels

Comments

@tmeasday
Copy link
Contributor

I've been meaning to create this for a while, the real cause is meteor/meteor#944.

If you join onto the same record twice (ie. you end up "publishing" it twice), if you then delete it, Meteor basically blows up.

Reproduction: clone https://github.com/tmeasday/meteor-pwr-deleting-bug

This project makes a simple Posts -> Authors relation, and creates two posts with the same author. It then publishes them via PWR.

  1. Run the project
  2. Check Authors.find().count() is 1
  3. Run Authors.remove(Authors.findOne()._id) in the browser console.

You should see continuous errors of the form:

Exception in queued task: Error: Removed nonexistent document WM8ejhCgZqaTd275c
    at _.extend.removed (app/packages/livedata/livedata_server.js:181:17)
    at _.extend.removed (app/packages/livedata/livedata_server.js:322:10)
    at _.extend.removed (app/packages/livedata/livedata_server.js:990:19)
    at collection.find.observeChanges.removed (app/packages/publish-with-relations/publish_with_relations.coffee.js:18:20)
    at _.each.self._callbackMultiplexer.(anonymous function) (app/packages/mongo-livedata/mongo_driver.js:704:34)
    at Array.forEach (native)
    at Function._.each._.forEach (app/packages/underscore/underscore.js:79:11)
    at Object._.each.self._callbackMultiplexer.(anonymous function) [as removed] (app/packages/mongo-livedata/mongo_driver.js:701:9)
    at app/packages/minimongo/diff.js:40:18
    at Function._.each._.forEach (app/packages/underscore/underscore.js:87:24)

Appear in the logs. The server also kind of dies once this happens.

It's readily apparent when using PWR with presences (as presences are deleted all the time and you usually want to join onto them). See tmeasday/meteor-presence#1

@svasva
Copy link
Owner

svasva commented Jun 2, 2013

Oh, I see. Will check what I can do to sort this.

@jonjamz
Copy link

jonjamz commented Jun 12, 2013

+1, I can't prove causality here because I'm not getting any specific error messages, but I did start getting server hangs once or twice a day since I switched to PWR.

It's only on my production server, and I can't seem to get my Meteor dev server to hang locally, for what it's worth.

@jonjamz
Copy link

jonjamz commented Jun 26, 2013

Update: After a lot of testing, I tracked my problem to lines 7-13 of PWR.

@dradovic
Copy link

dradovic commented Jul 8, 2013

I'm running into the same problem. Is there are solution coming up? Do you know a work-around?

@jonjamz
Copy link

jonjamz commented Jul 8, 2013

I worked on this for a while, couldn't find a workaround. Had to get off the package.

@tmeasday
Copy link
Contributor Author

tmeasday commented Jul 8, 2013

My workaround is to not use PWR for data that may be deleted, although @jonjamz thinks possibly he ran into problems even without deleting being involved, so that worries me.

I would probably steer clear of the package until further notice.

@svasva
Copy link
Owner

svasva commented Jul 16, 2013

Hey guys, I'm sorry to be that late on reply, but I'm working on a big meteor project that doesn't involve this package (yet) so I didn't have time to look closer at this problem (yet). Not sure when I'll be able to, so forks/pull requests are appreciated for sure.

@tmeasday
Copy link
Contributor Author

No worries Vitaly, I'm planning on looking at it too when I have a free moment. I know how you feel :)

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

No branches or pull requests

4 participants