bbyars / mountebank

Over the wire test doubles
http://www.mbtest.org
MIT License
2k stars 268 forks source link

Creating & deleting imposters in a load balanced setup #710

Open mike-gore-cko opened 2 years ago

mike-gore-cko commented 2 years ago

Expected behaviour

I have setup 3 Mountebank nodes that are load balanced. These all point to a shared storage volume using Amazon EFS. I have set the --datadir to a consistent location across all nodes --datadir /app/efs.

We do not use a config file, so the expected behaviour when I create an imposter is that I create an imposter and then it is available across all nodes of the load balanced cluster.

Similarly I would expect if I delete the imposter that all nodes show the imposter has been deleted.

Actual behaviour

In the creation scenario the imposter is only available on one node. I get a 404 response on the other nodes. The only way to work around this is to create the stub on all cluster nodes. When I do this I can successfully update the stubs within the imposter and that update is then available on all nodes.

In the deletion scenario when deleting, it succeeds. However, when I send requests to get the imposter on a different node it crashes with the following error message image

Steps to reproduce

Creation

  1. Create load balanced Mountebank using 3 nodes. Ensure the datadir is configured pointing at shared storage and there are no imposters already in the datadir location
  2. Create an imposter on one of the nodes
  3. Perform a get on the imposter you just created on the other nodes

Deletion

  1. Create load balanced Mountebank using 3 nodes. Ensure the datadir is configured pointing at shared storage and there is an imposter setup in the datadir location
  2. Delete an imposter on one of the nodes
  3. Perform a get on the imposter you just deleted

Software versions used

OS         : Linux
mountebank : 2.8.1
Installation method : Docker using the bbyars/mountebank:2.8.1 image

Log contents in mb.log when running mb --loglevel debug

Log contents here
btull89 commented 8 months ago

This issue caused us to abandon our mountebank efforts.