You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Attila Szabo (JIRA)" <ji...@apache.org> on 2018/02/14 18:13:00 UTC

[jira] [Comment Edited] (SQOOP-3283) MySQL thirdparty tests hang if there's no USER environment variable

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

Attila Szabo edited comment on SQOOP-3283 at 2/14/18 6:12 PM:
--------------------------------------------------------------

Hey [~dvoros],

Thanks for this contribution!

One additional thought:

You might also consider to open a new ticket for changing the behaviour of the build.xml file (line 196) b/c that might also cause unexpected behaviour (like MySQL complaining around "${env.USER}" username) , especially for those who devs/users who are not playing with ant since Java 1.2 (you could find ore detials here: [https://ant.apache.org/manual/Tasks/property.html#notes-env] )

 

Thanks,

[~maugli]


was (Author: maugli):
Hey [~dvoros],

Thanks for this contribution!

One additional thought:

You might be considering to open a new ticket for changing the behaviour of the build.xml file (line 196) b/c that might also cause unexpected behaviour (like MySQL complaining around "${env.USER}" username) , especially for those who devs/users who are not playing with ant since Java 1.2 (you could find ore detials here: [https://ant.apache.org/manual/Tasks/property.html#notes-env] )

 

Thanks,

[~maugli]

> MySQL thirdparty tests hang if there's no USER environment variable
> -------------------------------------------------------------------
>
>                 Key: SQOOP-3283
>                 URL: https://issues.apache.org/jira/browse/SQOOP-3283
>             Project: Sqoop
>          Issue Type: Bug
>          Components: connectors/mysql, test
>    Affects Versions: 1.4.7
>            Reporter: Daniel Voros
>            Assignee: Daniel Voros
>            Priority: Minor
>             Fix For: 1.5.0
>
>         Attachments: SQOOP-3283.1.patch, SQOOP-3283.2.patch
>
>
> {{org.apache.sqoop.manager.mysql.MySQLTestUtils#getCurrentUser()}} executes {{whoami}} in a subprocess if there's no USER environment variable (happened to me while running tests from Docker). However, it waits for the Process variable to become null, that never happens:
> {code:java}
> // wait for whoami to exit.
> while (p != null) {
>   try {
>     int ret = p.waitFor();
>     if (0 != ret) {
>       LOG.error("whoami exited with error status " + ret);
>       // suppress original return value from this method.
>       return null;
>     }
>   } catch (InterruptedException ie) {
>     continue; // loop around.
>   }
> }
> {code}
> We could get rid of the while loop since {{Process#waitFor()}} blocks while it completes.
> Note, that it's easy to workaround the issue by setting the USER environment variable when running the tests.



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