You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/21 13:55:00 UTC

[jira] [Commented] (AIRFLOW-3527) Cloud SQL proxy with UNIX sockets might lead to too long socket path

    [ https://issues.apache.org/jira/browse/AIRFLOW-3527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16726752#comment-16726752 ] 

ASF GitHub Bot commented on AIRFLOW-3527:
-----------------------------------------

potiuk opened a new pull request #4350: [AIRFLOW-3527] Cloud SQL Proxy has shorter path for UNIX socket
URL: https://github.com/apache/incubator-airflow/pull/4350
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow Jira](https://issues.apache.org/jira/browse/AIRFLOW-3527)
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   
   There is a limitation of UNIX socket path length as described in
   http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html#tag_13_67_04
   
   Cloud SQL Proxy uses generated path and it can get longer than the limit
   in case of POSTGRES connections especially (POSTGRES adds few characters on
   its own). The error returned by sqlproxy in this case is pretty vague
   (invalid path) - it makes it difficult to understand the problem by
   the user.
   
   This commit fixes it in two ways:
   * makes it less likely that the path length will be exceeded
   by shorter random string generated for the socket directory.
   * raises an Error in case of calculated path is too long
   ### Tests
   
   - [x] My PR adds the following unit tests:
   CloudSqlQueryValidationTest:
   * test_create_operator_with_too_long_unix_socket_path
   * test_create_operator_with_not_too_long_unix_socket_path
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [x] No documentation update is needed.
   
   ### Code Quality
   - [x] Passes `flake8`
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Cloud SQL proxy with UNIX sockets might lead to too long socket path
> --------------------------------------------------------------------
>
>                 Key: AIRFLOW-3527
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3527
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Jarek Potiuk
>            Priority: Major
>
> Currently Cloud SQL Proxy with UNIX sockets creates the proxy dir in /tmp/\{UDID1}/folder - which in case of postgres and long instance names might lead to too long name of UNIX socket (the path length for socket is limited to 108 characters in Linux). [http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html#tag_13_67_04]
> However in case instance name is long enough that leads to too long path (which turns to be fairly short - instance names can often exceed 20-30 characters)  and a cryptic "invalid path name" error. Therefor we need to 
> 1) generate the path with shorter random number prefix. 8 characters should be random enough + we can check if the generated path did not exist already and generate another one if that's the case.
> 2) fail validation in case the generated path is too long and propose a solution (shorter names or switching to TCP).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)