Skip to content

Commit

Permalink
IsolateonWireReceived to avoid completely broken protocol if someth…
Browse files Browse the repository at this point in the history
…ing went wrong (failed deserialization)
  • Loading branch information
Iliya-usov committed Sep 2, 2024
1 parent 396da37 commit c1e222e
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.jetbrains.rd.framework.impl.ProtocolContexts
import com.jetbrains.rd.util.Queue
import com.jetbrains.rd.util.Sync
import com.jetbrains.rd.util.blockingPutUnique
import com.jetbrains.rd.util.error
import com.jetbrains.rd.util.lifetime.Lifetime
import com.jetbrains.rd.util.lifetime.intersect
import com.jetbrains.rd.util.lifetime.isAlive
Expand Down Expand Up @@ -87,11 +88,14 @@ class MessageBroker(queueMessages: Boolean = false) : IPrintable {
return
}


AllowBindingCookie.allowBind {
val messageContext = protocol.contexts.readContext(buffer)
val helper = RdWireableDispatchHelper(entry.lifetime, id, protocol, messageContext)
entry.subscription.onWireReceived(buffer, helper)
try {
AllowBindingCookie.allowBind {
val messageContext = protocol.contexts.readContext(buffer)
val helper = RdWireableDispatchHelper(entry.lifetime, id, protocol, messageContext)
entry.subscription.onWireReceived(buffer, helper)
}
} catch (e: Throwable) {
log.error("Unexpected exception happened during processing a protocol event", e)
}
}

Expand Down

0 comments on commit c1e222e

Please sign in to comment.