merging changes from upstream
auto generated file. do not commit this.
when in thread we should not throw exceptions
added debug logging
added trail to console while waiting for the next output