-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix - resolve a deadlock(!) in the event handling.
This does not really fix the design, but resolves the issue in practice. The stream reassembly parser issues a callback every time it receives a piece of the stream from tshark. Prior to this change, I issued a call to app.Run() to update the UI with this data. For large pcaps with many chunks, this could call app.Run() hundreds of times per second. The event handling queue is only 1000 long, and a deadlock could result if (a) the UI is running a callback on the app goroutine (b) meanwhile, 1000 pieces of data arrive and are queued up on the event handling channel (c) the callback then itself issues a call to app.Run() The deadlock occurs because the app goroutine is the goroutine that listens to and processes UI input events; so if it is blocked from calling app.Run(), it never returns to process UI events. This resolves the issue in practice by updating the UI no more than 5 times a second during stream reassembly (which is more than enough). Meanwhile, I'll consider changes to gowid's event handling logic...
- Loading branch information
Showing
1 changed file
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters