Handling signals while "sleeping"

#### todo
- [ ] backport to `v2.5-stable`