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

Ensure vm-node to crete-run port file is not reused #12

Open
moralismercatus opened this issue Dec 22, 2016 · 0 comments
Open

Ensure vm-node to crete-run port file is not reused #12

moralismercatus opened this issue Dec 22, 2016 · 0 comments
Labels

Comments

@moralismercatus
Copy link
Collaborator

moralismercatus commented Dec 22, 2016

Scenario:

  1. vm-node starts the VM image
  2. The VM silently fails
  3. vm-node writes the port to file that the VM is expected to use
  4. vm-node waits indefinitely for crete-run to connect (also a separate issue)
  5. vm-node is restarted manually
  6. crete-run reads the old port file when the VM starts before vm-node has written a new one

Solution:

A fix should be simple. Just ensure the port file is removed before the VM image is started. This could be done in VMNodeFSM's ctor (or equivalent). A more robust solution is to follow the core guidelines R.1.

The present implementation is lacking sufficient resource (i.e., the port file) management:

// ...write port_file...
server->open_connection_wait();
fs::remove(port_file_path);

Clearly, this is inadequate. If open_connection_wait() throws, or vm-node is terminated between these two invocations, fs::remove() is not invoked, thus causing the same problem.

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

1 participant