the-one-pitt icon indicating copy to clipboard operation
the-one-pitt copied to clipboard

`NullPointerException` at `transferDone()` in `DecisionEngineRouter.java`

Open oleotiger opened this issue 6 years ago • 0 comments

In DecisionEngineRouter.java , Message transferred = this.getMessage(con.getMessage().getId()); may get transferred=null as con.getMessage() will return a message which is not in messages in this router already. getMessage() will return null on this condition.

This may occur when eg. M25 is transferred to N12 while the destination of M25 is N16 and N16 has received the message. Tuple <M25,N1>, <M25,N16>, <M25, N2> are added to outgoingMessages. In startTransfer() when test <M25,N16> , M25 should be deleted on N12. But tuple <M25,N2> is still in outgoingMessages and startTransfer() will return rcv_ok.

What's more, when a message is delete for ttl but it's still on transferring, what will happen? I think the transmission should be aborted but I didn't find where the program handle this situation

oleotiger avatar Mar 29 '18 16:03 oleotiger