Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3232#discussion_r98445731
  
    --- Diff: 
flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/plan/Environment.py
 ---
    @@ -27,17 +27,24 @@
     import sys
     from struct import pack
     
    +_env_counter = 0
    +_last_env_id = -1
    +_operating = False
    --- End diff --
    
    We have to simplify these things.
    
    How about this:
    
    Create a global Container that contains all created Environments and stores 
them in a list. It should have a method like `create_execution_environment()` 
that returns a new Environment with the appropriate counter.
    
    When `execute()` is called we then do something like this:
    ```
    envID = this.container.fetch_id_of_env_to_execute()
    if this.envID == envID:
        //execute stuff as usual
    else:
        return //fall-through
    ```
    
    We would then no longer need any global variable.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to