fix race condition during publishing
channel timeout shouldn't be 0!
don't use rwlock yet
cleanup
teststuff