[jitsi-dev] [jitsi-videobridge] fix(Close Stream Race): Race condition closing a stream resulting in NullPointer (#85)


#1

This fixes the NPE when two threads attempt to close the channel at the same time:

java.lang.NullPointerException
	at org.jitsi.videobridge.RtpChannel.closeStream(RtpChannel.java:599)
	at org.jitsi.videobridge.Channel.expire(Channel.java:339)
	at org.jitsi.videobridge.VideobridgeExpireThread.expire(VideobridgeExpireThread.java:141)
	at org.jitsi.videobridge.VideobridgeExpireThread.run(VideobridgeExpireThread.java:216)

You can view, comment on, or merge this pull request online at:

  https://github.com/jitsi/jitsi-videobridge/pull/85

-- Commit Summary --

  * fix(Close Stream Race): Race condition closing a stream resulting in NullPointer

-- File Changes --

    M src/main/java/org/jitsi/videobridge/RtpChannel.java (6)

-- Patch Links --

https://github.com/jitsi/jitsi-videobridge/pull/85.patch
https://github.com/jitsi/jitsi-videobridge/pull/85.diff

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-videobridge/pull/85


#2

Corporate CLA signed; this account should be a listed account now.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-videobridge/pull/85#issuecomment-141183002


#3

+1

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-videobridge/pull/85#issuecomment-143406706


#4

ACK on the CLA. And thank you for the contribution!

The patch looks good to me, but I am trying to understand under what conditions the problem occurs. Unless I am missing something RtpChannel#closeStream is only called from Channel#expire, which makes sure it executes only once.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-videobridge/pull/85#issuecomment-143768029


#5

Can one of the admins verify this patch?

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-videobridge/pull/85#issuecomment-192016159