SNOW-1903844: Closing an already closed SnowflakeDatabaseMetaDataResultSet triggers logs in DriverManager.getLogWriter() #2057
Labels
feature
status-information_needed
Additional information is required from the reporter
status-triage_done
Initial triage done, will be further handled by the driver team
What is the current behavior?
This is the
close()
method ofSnowflakeDatabaseMetaDataResultSet
:If the result set is already closed,
getStatement()
will create aSnowflakeSQLException
catched in the catch blog.But creating such SqlException will call the
DriverManager.getLogWriter()
and log the whole StackTrace if the log writer is set.Closing an already closed
SnowflakeDatabaseMetaDataResultSet
can easily happen as callingnext()
on the last row will close it, so a code like this will callclose()
twice:This is not a big deal but it is really polluting my logs a lot for no reason when setting up a log writer in the DriverManager.
What is the desired behavior?
Do not create a SqlException if the ResultSet is already closed, just do nothing
How would this improve
snowflake-jdbc
?It would make the driver easier to debug as we have less noise when enabling the DriverManager log writer.
I can make a PR to improve it if needed, I think you can simply do
References, Other Background
this is a stack trace which I se for every metadata query I'm doing:
The text was updated successfully, but these errors were encountered: