[ 
https://issues.apache.org/jira/browse/ARTEMIS-4401?focusedWorklogId=879449&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-879449
 ]

ASF GitHub Bot logged work on ARTEMIS-4401:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Sep/23 11:47
            Start Date: 08/Sep/23 11:47
    Worklog Time Spent: 10m 
      Work Description: gtully commented on code in PR #4591:
URL: https://github.com/apache/activemq-artemis/pull/4591#discussion_r1319769650


##########
artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java:
##########
@@ -332,13 +409,15 @@ public void close(boolean waitOnSync, boolean block) 
throws Exception {
 
    @Override
    public void sync() throws IOException {
-      final SimpleWaitIOCallback callback = new SimpleWaitIOCallback();
-      executor.execute(callback::done);
-
       try {
-         callback.waitCompletion();
+         // 30 seconds is an eternity here. If there's no response within 
SYNC_TIMEOUT milliseconds
+         // nothing better could be done other than onIOError which will 
likely shutdown the broker.
+         // If this ever happens the broker will be probably failing in other 
places as well
+         // due to the lack of connectivity with the database
+         if (!pendingWrites.await(SYNC_TIMEOUT, TimeUnit.MILLISECONDS)) {

Review Comment:
   in a sense, the broker needs to be very tolerant to delays, a db can be very 
slow and still work. This is where a non blocking architecture and blocking 
work need to coordinate to ensure there is some upper bound on pending work, 
that pushed back to the network.
   If there is a ha rack behind the jdbc connecton and it is doing work to sync 
replicate and then transparently failover, the broker needs to be patient and 
wait. messaging client may timeout, but I think the expectaiton is that the 
broker stays alive. There can be a configurable upper bound on jdbc io 
operations, but I think a hardcoded 30s will cause us trouble. Any value of an 
jdbc_io timeout would need to be correlated with the jdbc url.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 879449)
    Time Spent: 0.5h  (was: 20m)

> slow performance of JDBC while paging
> -------------------------------------
>
>                 Key: ARTEMIS-4401
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4401
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.31.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Syncs are not properly implemented into page files. Basically ever message 
> sent and every blob update is issuing a sync update on the context and a 
> commit on the Database.
> Certain databases will have an OK performance with lots of commits (e.g. 
> Postgres) but I'm not sure how correct is the blob update.
> As part of this task I'm creating a few Database tests to validate these 
> changes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to