Skip to content

Conversation

@bugraoz93
Copy link
Contributor

@bugraoz93 bugraoz93 commented May 7, 2025

Bug introduced in: #49482
Moved the _get_conn_params call to the drive class (SnowflakeSqlApiHook) since it was there in the first place. Now SnowflakeSqlApiHook is calling the _get_conn_params, but it is _get_conn_params calls from super().get_oauth_token() again, so it shouldn't do any infinite loops. The original method was added without None in the conn_config parameter, so converting that back since it isn't needed and is backwards compatible. At the worst case, it should call super().get_oauth_token() twice.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@bugraoz93 bugraoz93 requested review from eladkal and gopidesupavan May 7, 2025 18:26
@bugraoz93 bugraoz93 requested review from mik-laj and potiuk as code owners May 7, 2025 18:26
@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels May 7, 2025
@bugraoz93
Copy link
Contributor Author

cc: @eladkal @gopidesupavan

@bugraoz93
Copy link
Contributor Author

cc: @Sharashchandra, if you have time and can test too, that would be amazing!

@bugraoz93
Copy link
Contributor Author

CI is unrelated

gremlin: ..................................................ERROR: Maximum number of retries while checking service. Exiting 

@bugraoz93 bugraoz93 force-pushed the bugfix/infinite-loop-snowflake-hooks branch from 7b91ad7 to 4d94f90 Compare May 7, 2025 19:59
@Sharashchandra
Copy link
Contributor

Sharashchandra commented May 8, 2025

Hi @bugraoz93 , this still does not fix the infinite loop issue. The property "self._get_conn_params" is first called from get_conn(). The function inturn calls the get_oauth_token. The first line of the get_oauth_token is referring to the property "self.account_identifier" to construct the url which inturn calls the self._get_conn_params. SInce the property "self._get_conn_params" hasn't completed executing and therefore not caches, it goes on an infinite loop.

The infinite loop is caused by calling "self.account_identifier" in the get_oauth_token function.
I've raised a PR with the fix, #50344

@bugraoz93
Copy link
Contributor Author

Hi @bugraoz93 , this still does not fix the infinite loop issue. The property "self._get_conn_params" is first called from get_conn(). The function inturn calls the get_oauth_token. The first line of the get_oauth_token is referring to the property "self.account_identifier" to construct the url which inturn calls the self._get_conn_params. SInce the property "self._get_conn_params" hasn't completed executing and therefore not caches, it goes on an infinite loop.

The infinite loop is caused by calling "self.account_identifier" in the get_oauth_token function.
I've raised a PR with the fix, #50344

Okay, my assumption was we are calling get_conn_params, and that is calling the same method get_oauth_token recursively. I missed the account identifier also calling that, nice one!

@bugraoz93 bugraoz93 closed this May 8, 2025
@bugraoz93
Copy link
Contributor Author

Closed in favor of #50344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants