reduce lock-time when creating datasources - #2317