worstcase / blockade

Docker-based utility for testing network failures and partitions in distributed applications

Home Page:http://blockade.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iptables call fails on very long folder names

volkerstampa opened this issue · comments

By default blockade bases the name of iptables chains on the name of the folder where the blockade.yml resides. In case of long folder names this leads to the following exception:

iptables v1.4.21: chain name `blockade-countercassandraacyclic-p1' too long (must be under 29 chars)
Try `iptables -h' or 'iptables --help' for more information.
Traceback (most recent call last):
  File "../../crdt-counter-partitions.py", line 99, in <module>
    if not interact.requests_with_chaos(OPS, HOST, NODES, ARGS.iterations, ARGS.interval, ARGS.settle, ARGS.delay, ARGS.restarts):
  File "/vagrant/interact.py", line 156, in requests_with_chaos
    part = blk.random_partition()
  File "/blockade/blockade/core.py", line 390, in random_partition
    self.partition(partitions, state)
  File "/blockade/blockade/core.py", line 404, in partition
    container_partitions)
  File "/blockade/blockade/net.py", line 62, in partition_containers
    partition_containers(blockade_id, partitions)
  File "/blockade/blockade/net.py", line 298, in partition_containers
    iptables_create_chain(chain_name)
  File "/blockade/blockade/net.py", line 246, in iptables_create_chain
    iptables_call("-N", chain)
  File "/blockade/blockade/net.py", line 133, in iptables_call
    raise BlockadeError(error)
blockade.errors.BlockadeError: Problem calling 'iptables -N blockade-countercassandraacyclic-p1'

Maybe it makes sense to truncate the folder name before using it as blockade_id?