bamaer commented on PR #9108:
URL: https://github.com/apache/hop/pull/9108#issuecomment-6435664707

   @mattcasters thanks for picking this up. Recovering an aborted session makes 
sense. A few points about how wide the detection is:
   
   **1. The message fallback matches more than missing tables.** 
`contains("relation") && contains("does not exist")` also matches PostgreSQL's 
`column "x" of relation "y" does not exist` (`42703`). Since the SQLState is 
already checked, could the message fallback be dropped, or limited to messages 
about missing tables?
   
   **2. `42P01` / `3F000` when the table really is missing.** This location 
doesn't create its table. On an install where the DDL hasn't been run, or with 
a wrong schema or table name, each flush tick now adds a reconnect, a second 
attempt, and a basic-level log line per dirty entry. One option: retry those 
two codes only when `checkTableExists` succeeds on the new connection.
   
   **3. The trigger.** The connection runs with auto-commit on, which normally 
rules out `25P02`. Do you have the log or the setup where `25P02` / `42P01` 
showed up? For example, did auto-commit fail to switch on ("stays with the 
driver's commit mode"), or was there a pooler or a role-level `search_path` in 
between? Knowing that would show which codes need the retry.
   
   **4. Logging.** When the retry succeeds, the first error is lost. Adding 
`e.getMessage()` to the "Rolling back, disconnecting, and retrying once" line 
would keep it.
   
   **5. Tests.** The new test covers the classifier only. A test of the retry 
itself would help, using the same H2 setup as 
`persistReopensAClosedJdbcConnection`. For example: one call that fails with 
`25P02` and then succeeds on the retry, and one persist against a dropped table 
that doesn't reconnect over and over. A `3F000` case and a negative case for 
the column message would round off the classifier test.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to