Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/164#discussion_r75602598
  
    --- Diff: 
jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java 
---
    @@ -613,21 +652,43 @@ public void flush() {
         }
         
         // -- The main operations to undertake when a transaction finishes.
    -    // Called from TSM_WriteBackEndTxn but the worker code is shere so all
    +    // Called from TSM_WriteBackEndTxn but the worker code is here so all
         // related code, including queue flushing is close together.
         
         private void readerFinishesWorker(Transaction txn) {
    -        if ( queue.size() >= QueueBatchSize )
    +        if ( checkForJournalFlush() )
                 processDelayedReplayQueue(txn) ;
         }
    -
    +    
         private void writerAbortsWorker(Transaction txn) {
    -        if ( queue.size() >= QueueBatchSize )
    +        if ( checkForJournalFlush() )
                 processDelayedReplayQueue(txn) ;
         }
         
    +    // Whether to try to flush the journal. We may stil find that we are 
blocked
    +    // from doing so by another transaction.
    +    private boolean checkForJournalFlush() {
    +//        System.err.printf("checkForJournalFlush: queue size=%d; journal 
size = %d\n", queue.size(), journal.size()) ;
    +//        System.err.printf("checkForJournalFlush: QueueBatchSize=%d; 
MaxQueueThreshold=%d; JournalThresholdSize=%d\n",
    +//                          QueueBatchSize, MaxQueueThreshold, 
JournalThresholdSize) ;
    +        if ( QueueBatchSize == 0 )
    --- End diff --
    
    I'm probably missing something, but it seems like this is part of the next 
case (isn't `queue.size() >= 0` an invariant?). Is this called out just to 
emphasize that setting `0` => "no queuing"?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to