Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BarrageMessageProducer: Do Not Always Record Stream Table Rows #3857

Merged
merged 3 commits into from
May 23, 2023

Conversation

nbauernfeind
Copy link
Member

Tested manually using reproducer provided by Devin:

START_OPTS=-Xmx1g ./gradlew server-jetty-app:run -Pgroovy
import io.deephaven.engine.table.impl.TimeTable
x = TimeTable.newBuilder().streamTable(true).period(20).build()

I also ran Barrage Message Round Trip Tests.

The UI performance gets hit pretty hard by the 20ns period. I'm a little surprised by this, but decreasing to 1us is sufficient to eliminate the performance issue.

@nbauernfeind nbauernfeind added this to the May 2023 milestone May 22, 2023
@nbauernfeind nbauernfeind self-assigned this May 22, 2023
Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that the UI is still slow; aren't we sending much smaller updates to the web UI?

Potentially not related, but I'm also seeing some failures when this table is reversed (I'm assuming the web UI applies a table.reverse(); I'm assuming "reverse viewport" is something else?)

2023-05-22T18:23:30.895Z | EFAULT.refreshThread | ERROR | rumentedTableListenerBase | Uncaught exception for entry= reverse(), added.size()=50025900, modified.size()=0, removed.size()=50009200, shifted.size()=0, modifiedColumnSe
t={EMPTY}:                                                                                                                                                                                                                          
io.deephaven.base.verify.AssertionFailure: Assertion failed: asserted update.shifted.empty().                                                                                                                                       
        at io.deephaven.base.verify.Assert.fail(Assert.java:86)                                                                                                                                                                     
        at io.deephaven.base.verify.Assert.assertion(Assert.java:116)                                                                                                                                                               
        at io.deephaven.engine.table.impl.BaseTable.notifyListeners(BaseTable.java:637)
        at io.deephaven.engine.table.impl.ReverseOperation.onUpdate(ReverseOperation.java:225)
        at io.deephaven.engine.table.impl.ReverseOperation$2.onUpdate(ReverseOperation.java:104)
        at io.deephaven.engine.table.impl.InstrumentedTableUpdateListener$Notification.lambda$run$0(InstrumentedTableUpdateListener.java:37)
        at io.deephaven.engine.table.impl.InstrumentedTableListenerBase$NotificationBase.doRunInternal(InstrumentedTableListenerBase.java:283)
        at io.deephaven.engine.table.impl.InstrumentedTableListenerBase$NotificationBase.doRun(InstrumentedTableListenerBase.java:261)
        at io.deephaven.engine.table.impl.InstrumentedTableUpdateListener$Notification.run(InstrumentedTableUpdateListener.java:37)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.runNotification(UpdateGraphProcessor.java:1285)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor$QueueNotificationProcessor.doWork(UpdateGraphProcessor.java:1461)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.flushNormalNotificationsAndCompleteCycle(UpdateGraphProcessor.java:1164)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.flushNotificationsAndCompleteCycle(UpdateGraphProcessor.java:1109)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.lambda$doRefresh$11(UpdateGraphProcessor.java:1744)
        at io.deephaven.util.locks.FunctionalLock.doLocked(FunctionalLock.java:33)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.doRefresh(UpdateGraphProcessor.java:1732)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.refreshAllTables(UpdateGraphProcessor.java:1719)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.refreshTablesAndFlushNotifications(UpdateGraphProcessor.java:1573)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.lambda$new$3(UpdateGraphProcessor.java:270)
        at java.lang.Thread.run(Thread.java:829)

2023-05-22T18:23:30.897Z | EFAULT.refreshThread | ERROR | .AsyncClientErrorNotifier | Error in table update: io.deephaven.base.verify.AssertionFailure: Assertion failed: asserted update.shifted.empty().
        at io.deephaven.base.verify.Assert.fail(Assert.java:86)
        at io.deephaven.base.verify.Assert.assertion(Assert.java:116)
        at io.deephaven.engine.table.impl.BaseTable.notifyListeners(BaseTable.java:637)
        at io.deephaven.engine.table.impl.ReverseOperation.onUpdate(ReverseOperation.java:225)
        at io.deephaven.engine.table.impl.ReverseOperation$2.onUpdate(ReverseOperation.java:104)
        at io.deephaven.engine.table.impl.InstrumentedTableUpdateListener$Notification.lambda$run$0(InstrumentedTableUpdateListener.java:37)
        at io.deephaven.engine.table.impl.InstrumentedTableListenerBase$NotificationBase.doRunInternal(InstrumentedTableListenerBase.java:283)
        at io.deephaven.engine.table.impl.InstrumentedTableListenerBase$NotificationBase.doRun(InstrumentedTableListenerBase.java:261)
        at io.deephaven.engine.table.impl.InstrumentedTableUpdateListener$Notification.run(InstrumentedTableUpdateListener.java:37)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.runNotification(UpdateGraphProcessor.java:1285)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor$QueueNotificationProcessor.doWork(UpdateGraphProcessor.java:1461)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.flushNormalNotificationsAndCompleteCycle(UpdateGraphProcessor.java:1164)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.flushNotificationsAndCompleteCycle(UpdateGraphProcessor.java:1109)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.lambda$doRefresh$11(UpdateGraphProcessor.java:1744)
        at io.deephaven.util.locks.FunctionalLock.doLocked(FunctionalLock.java:33)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.doRefresh(UpdateGraphProcessor.java:1732)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.refreshAllTables(UpdateGraphProcessor.java:1719)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.refreshTablesAndFlushNotifications(UpdateGraphProcessor.java:1573)
        at io.deephaven.engine.updategraph.UpdateGraphProcessor.lambda$new$3(UpdateGraphProcessor.java:270)
        at java.lang.Thread.run(Thread.java:829)

@nbauernfeind nbauernfeind force-pushed the barrage_oom branch 2 times, most recently from e1b6bbc to 07a9d6a Compare May 22, 2023 20:14
@devinrsmith
Copy link
Member

I've filed the previous stack trace as #3858 (which is reproducible on 0.24.1 release).

Here's another stack trace specific to the BarrageMessageProducer I've created with your latest commit:

2023-05-22T20:10:46.206Z | heduler-Concurrent-2 | ERROR | .b.BarrageMessageProducer | Internal Error '3a0f4c54-1a74-4daa-a581-1e05aff9c3f2' java.lang.IllegalArgumentException: Out of order key(s) in sequential builder: last=999929 while appending range start=0, end=1000416
        at io.deephaven.engine.rowset.impl.RspBitmapBuilderSequential.appendRange(RspBitmapBuilderSequential.java:85)                                                                                                                                                            
        at io.deephaven.engine.rowset.impl.OrderedLongSetBuilderSequential.lambda$appendOrderedLongSet$0(OrderedLongSetBuilderSequential.java:82)                                                                                                                                
        at io.deephaven.engine.rowset.impl.singlerange.SingleRange.ixForEachLongRange(SingleRange.java:114)                             
        at io.deephaven.engine.rowset.impl.OrderedLongSetBuilderSequential.appendOrderedLongSet(OrderedLongSetBuilderSequential.java:81)                                                                                                                                         
        at io.deephaven.engine.rowset.impl.BasicRowSetBuilderSequential.appendRowSequenceWithOffset(BasicRowSetBuilderSequential.java:29)                                                                                                                                        
        at io.deephaven.engine.rowset.impl.BasicRowSetBuilderSequential.appendRowSequence(BasicRowSetBuilderSequential.java:23)                                                                                                                                                  
        at io.deephaven.server.barrage.BarrageMessageProducer.aggregateUpdatesInRange(BarrageMessageProducer.java:1623)                                                                                                                                                          
        at io.deephaven.server.barrage.BarrageMessageProducer.updateSubscriptionsSnapshotAndPropagate(BarrageMessageProducer.java:1371)                                                                                                                                          
        at io.deephaven.server.barrage.BarrageMessageProducer$UpdatePropagationJob.run(BarrageMessageProducer.java:988)                                                                                                                                                          
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)                                                      
        at java.util.concurrent.FutureTask.run(FutureTask.java:264)                                                                     
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)                                                                                                                                                        
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)                                              
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)                                              
        at io.deephaven.server.runner.DeephavenApiServerModule$ThreadFactory.lambda$newThread$0(DeephavenApiServerModule.java:162)                                                                                                                                               
        at java.lang.Thread.run(Thread.java:833)                    

2023-05-22T20:10:47.193Z | heduler-Concurrent-2 | ERROR | .b.BarrageMessageProducer | Internal Error '21f71be6-bb64-4af9-8525-efca9197e33d' java.lang.IllegalArgumentException: Out of order key(s) in sequential builder: last=999929 while appending range start=0, end=1000416
        at io.deephaven.engine.rowset.impl.RspBitmapBuilderSequential.appendRange(RspBitmapBuilderSequential.java:85)                                                                                                                                                            
        at io.deephaven.engine.rowset.impl.OrderedLongSetBuilderSequential.lambda$appendOrderedLongSet$0(OrderedLongSetBuilderSequential.java:82)                                                                                                                                
        at io.deephaven.engine.rowset.impl.singlerange.SingleRange.ixForEachLongRange(SingleRange.java:114)                             
        at io.deephaven.engine.rowset.impl.OrderedLongSetBuilderSequential.appendOrderedLongSet(OrderedLongSetBuilderSequential.java:81)                                                                                                                                         
        at io.deephaven.engine.rowset.impl.BasicRowSetBuilderSequential.appendRowSequenceWithOffset(BasicRowSetBuilderSequential.java:29)                                                                                                                                        
        at io.deephaven.engine.rowset.impl.BasicRowSetBuilderSequential.appendRowSequence(BasicRowSetBuilderSequential.java:23)                                                                                                                                                  
        at io.deephaven.server.barrage.BarrageMessageProducer.aggregateUpdatesInRange(BarrageMessageProducer.java:1623)                                                                                                                                                          
        at io.deephaven.server.barrage.BarrageMessageProducer.updateSubscriptionsSnapshotAndPropagate(BarrageMessageProducer.java:1371)                                                                                                                                          
        at io.deephaven.server.barrage.BarrageMessageProducer$UpdatePropagationJob.run(BarrageMessageProducer.java:988)                                                                                                                                                          
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)                                                      
        at java.util.concurrent.FutureTask.run(FutureTask.java:264)                                                                     
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)                                                                                                                                                        
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)                                              
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)                                              
        at io.deephaven.server.runner.DeephavenApiServerModule$ThreadFactory.lambda$newThread$0(DeephavenApiServerModule.java:162)                                                                                                                                               
        at java.lang.Thread.run(Thread.java:833)

I'm not sure if this is the same bug as reverse, or not.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this as-is, once you fix the invert bug you identified. Maybe consider assertions for !reverse when accumulating deltes, and for no-mods.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caught up

@nbauernfeind
Copy link
Member Author

nbauernfeind commented May 23, 2023

Here's another stack trace specific to the BarrageMessageProducer I've created with your latest commit:

This one I was able to reproduce and should be all fixed now. Things appear to work AFAICT.

I'm rebasing and fixing up for the stream table to blink table change; will be ready soon.

@nbauernfeind nbauernfeind merged commit 09ccd15 into deephaven:main May 23, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants