Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/1946#issuecomment-52395698
  
    Thanks for digging into this !
    
    From what I see, this is an implementation detail of a specific jdk version
    (order in which syscall returns and order in which java handles it) and
    subject to arbitrary change : I am not sure why the order is the way it is
    as mentioned by you, but there might be some rationale for it .... would be
    good to raise a jdk bug and get it clarified.
    
    Which is not to say we can't include it in some future release of spark ,
    if it makes end-user life easier - in case it is a jre limitations : as
    Patrick mentioned, we need to ensure it does not break for existing users.
     On 16-Aug-2014 9:41 am, "叶先进" <notificati...@github.com> wrote:
    
    > @pwendell <https://github.com/pwendell> @mridulm
    > <https://github.com/mridulm> no, this behavior is not documented. The
    > java SE doc doesn't say anything about ordering.. So before filing the
    > JIRA, I looked up the OpenJDK source code, both 6 and 7.
    > Maybe I should post some snippets here.
    > In openjdk-6-src-b27,
    > jdk/src/windows/native/java/net/NetworkInterface.c Line335-
    >
    >         /*
    >          * Put the interface at tail of list as GetIfTable(,,TRUE) is
    >          * returning the interfaces in index order.
    >          */
    >         count++;
    >         if (netifP == NULL) {
    >             netifP = curr;
    >         } else {
    >             netif *tail = netifP;
    >             while (tail->next != NULL) {
    >                 tail = tail->next;
    >             }
    >             tail->next = curr;
    >         }
    >
    >
    > jdk/src/solaris/native/java/net/NetworkInterface.c function *addif 
Line1000
    >
    >     /*
    >      * If "new" then create an netif structure and
    >      * insert it onto the list.
    >      */
    >     if (currif == NULL) {
    >         currif = (netif *)malloc(sizeof(netif));
    >         if (currif) {
    >             currif->name = strdup(name);
    >             if (currif->name == NULL) {
    >                 free(currif);
    >                 currif = NULL;
    >             }
    >         }
    >         if (currif == NULL) {
    >             JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
    >             return ifs;
    >         }
    >         currif->index = index;
    >         currif->addr = NULL;
    >         currif->childs = NULL;
    >         currif->virtual = isVirtual;
    >         currif->next = ifs;
    >         ifs = currif;
    >     }
    >
    > Of course, the whole flow is more complicated, but you can get the idea.
    > Source code in OpenJDk7 is similar, I won't post it here as this is a long
    > comment.
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/spark/pull/1946#issuecomment-52382756>.
    >


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to