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

FilesystemStorage hits concurrent assignment #18

Open
zarvox opened this issue Jan 5, 2016 · 9 comments
Open

FilesystemStorage hits concurrent assignment #18

zarvox opened this issue Jan 5, 2016 · 9 comments

Comments

@zarvox
Copy link
Collaborator

zarvox commented Jan 5, 2016

I left a tab with Oasis open, with a single Wekan grain open, and didn't look at it for a while. I suspend/resumed my laptop, biked home, changed networks, and when I looked back at the tab in question, I see this exception:

Error: Error: remote exception: remote exception: remote exception: remote exception: remote exception: Assignable modified concurrently
C++ location:(javascript):??
type: disconnected

A little digging suggests this is from https://github.com/sandstorm-io/blackrock/blob/master/src/blackrock/fs-storage.c%2B%2B#L1559..L1575 :

      if (expectedVersion > 0) {
        if (object.version != expectedVersion) {
          return KJ_EXCEPTION(DISCONNECTED, "Assignable modified concurrently");
        }
        ++expectedVersion;
      }

pixels1

@kentonv
Copy link
Member

kentonv commented Jan 5, 2016

By any chance did you have the grain open in multiple browser windows?

@zarvox
Copy link
Collaborator Author

zarvox commented Jan 5, 2016

I think I may have had it open at some point in there on a second (different profile) browser.

@kentonv
Copy link
Member

kentonv commented Jan 5, 2016

OK, my guess is that both browsers asked the server to re-establish the connection at the same time (when the network came back), causing two different front-ends to try to start up the grain at the same time, and one of them lost the optimistic concurrency race.

To fix this, we need to insert a retry somewhere.

@paulproteus
Copy link
Collaborator

FWIW I think I ran into this just now without having my https://oasis.sandstorm.io/grain/SHcGmtX3NaDHmisZqrNpsd/ grain open in multiple browsers.

@paulproteus
Copy link
Collaborator

Thanks hugely to @zarvox for doing the grep to find this string. I was wondering about it but didn't think to grep blackrock as well as sandstorm.

@paulproteus
Copy link
Collaborator

My laptop did go through a suspend-resume cycle, fwiw, so that's a similar story to @zarvox 's story.

@zarvox
Copy link
Collaborator Author

zarvox commented Jan 7, 2016

This happened again, except this time, I only had the grain open in one location. It's possible a different user who also has access to the grain had it open at the time this was triggered, but they do not appear to be connected to the grain (wekan shows currently-connected users) when I refreshed my browser window.

How likely do you think that there's something else going on here?

@zarvox
Copy link
Collaborator Author

zarvox commented Jan 7, 2016

The suspend-resume cycle seems to be a constant in this buggy setup.

@kentonv
Copy link
Member

kentonv commented Jan 9, 2016

I'm 90% confident this is optimistic concurrency working as intended -- except that the caller is failing to retry as it should.

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

3 participants