Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In 1.1.5 we fixed an issue with windows build. Windows would not create container if the socket doesn't exist.
However, the socket was created in "start" which comes after "create" of containers, so 1.1.5 would not work properly on windows if socket didn't exist beforehand.
The fix was to move the socket creation in "create" stage, this however creates another issue.
The server for the workload API starts in the create stage and get stopped when the container is stopped.
However, when a container is stopped, it is still "created" so it can be restarted without going through the "create" stage.
So stopping a module would kill the workload API server and restarting it, would make it running again but would not start the workload server because it is created in "create".
In the 1.1.5 fix, this was tested: 382cf77
Removing a module and restarting it (without removing it) was not tried. Hence the issue went through the net.
The workaround the issue is simple:
Test:
Linux
Create a module "registry" and check it responds to curl --unix-socket /var/lib/iotedge/mnt/registry.sock http://hello
stop a module "registry" and check it still respond to curl --unix-socket /var/lib/iotedge/mnt/registry.sock http://hello
start a module "registry" and check it still respond to curl --unix-socket /var/lib/iotedge/mnt/registry.sock http://hello
Tested on both linux and windows (no curl on windows)
Killed a container and check it restarts correctly. Check in the logs that listener is created
Put a dummy variable in edge Agent to force a restart.
Simple iotedge restart.
Start/Stop/start a container.