tomp2p/TomP2P — Issue #1: RuntimeException when removing value
Author: stsmedia
Created: 2012-01-11 03:30:38+00:00
State: open

We have an issue where Peer.remove throws a RuntimeException. This appears to happen if Netty is used for multiple purposes in the application (not just by TomP2P). In line 100 ConnectionReservation you check the name of the current thread to see if it is a thread coming out of a Netty thread pool (thread name = "Netty thread (non-blocking)/ "), leading to the following exception:

```java
java.lang.RuntimeException: cannot block here
at net.tomp2p.connection.ConnectionReservation.reserve(ConnectionReservation.java:104)
at net.tomp2p.connection.ConnectionReservation.reserve(ConnectionReservation.java:83)
at net.tomp2p.p2p.Peer.remove(Peer.java:1321)
at net.tomp2p.p2p.Peer.remove(Peer.java:1295)
```
I have a local test which just uses TomP2P and can not reproduce the issue. However when we run our application which uses Netty for other purposes we see this exception.