gaborgsomogyi commented on a change in pull request #28368:
URL: https://github.com/apache/spark/pull/28368#discussion_r420698301



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/DB2ConnectionProvider.scala
##########
@@ -48,7 +48,7 @@ private[sql] class DB2ConnectionProvider(driver: Driver, 
options: JDBCOptions)
     result
   }
 
-  override def setAuthenticationConfigIfNeeded(): Unit = {
+  override def setAuthenticationConfigIfNeeded(): Unit = 
SecurityConfigurationLock.synchronized {

Review comment:
       So basically I've done manual integration test. Let me explain what that 
means. Here is my project where I've created several docker images to achieve 
manual kerberos connection (where possible with docker): 
https://github.com/gaborgsomogyi/docker-kerberos
   
   I've build everything and then started the following docker servers:
   ```
   ./run-kdc-kadmin.sh
   ./run-postgres.sh
   ./run-mariadb.sh
   ```
   
   When each and every service was up and running I've copied the `krb5.conf` 
and made minor modifications in the content:
   ```
   [gaborsomogyi:~/spark] SPARK-31575-multi-test 5s ± cat /etc/krb5.conf
   [libdefaults]
        udp_preference_limit=1 # This is needed to achieve TCP because Mac has 
problem with UDP
        default_realm = EXAMPLE.COM
        forwardable = true
   
   [realms]
        EXAMPLE.COM = {
                kdc_ports = 88
                kadmind_port = 749
                kdc = 192.168.0.188
                admin_server = 192.168.0.188
        }
   ```
   
   Added a new entry to `/etc/hosts` file:
   ```
   192.168.0.188 example.com
   ```
   
   Please note 192.168.0.188 is my local address where docker runs.
   
   And finally I've executed the newly added `MultiKrbIntegrationSuite` test 
which connected to the 2 database instances within a single JVM: 
https://github.com/gaborgsomogyi/spark/blob/bdb573a287f26e28781084a7d8eefd10bb4ece3d/external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MultiKrbIntegrationSuite.scala#L31
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to