You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by uce <gi...@git.apache.org> on 2015/02/09 11:53:42 UTC

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

GitHub user uce opened a pull request:

    https://github.com/apache/flink/pull/376

    [FLINK-1492] Fix exceptions on blob store shutdown

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uce/incubator-flink flink-1492-proper_shutdown_hook

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/376.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #376
    
----
commit f29132ca9fb549d47a29322695f467996ed727a4
Author: Ufuk Celebi <uc...@apache.org>
Date:   2015-02-09T10:44:47Z

    [FLINK-1492] Fix exceptions on blob store shutdown

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73667317
  
    Looks good.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/376


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73699625
  
    OK, thanks. Just a reminder: we need to include this in 0.8.1 as well.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/376#discussion_r24407836
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServer.java ---
    @@ -196,23 +199,28 @@ public void run() {
     	 */
     	@Override
     	public void shutdown() throws IOException {
    -
    -		this.shutdownRequested = true;
    -		try {
    -			this.serverSocket.close();
    -		} catch (IOException ioe) {
    +		if (shutdownRequested.compareAndSet(false, true)) {
    +			try {
    +				this.serverSocket.close();
    +			}
    +			catch (IOException ioe) {
     				LOG.debug("Error while closing the server socket.", ioe);
    -		}
    -		try {
    -			join();
    -		} catch (InterruptedException ie) {
    -			LOG.debug("Error while waiting for this thread to die.", ie);
    -		}
    +			}
    +			try {
    +				join();
    --- End diff --
    
    Ah of course. Thanks for the clarification.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73500986
  
    Yes, if it is finally OK.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/376#discussion_r24402830
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServer.java ---
    @@ -196,23 +199,28 @@ public void run() {
     	 */
     	@Override
     	public void shutdown() throws IOException {
    -
    -		this.shutdownRequested = true;
    -		try {
    -			this.serverSocket.close();
    -		} catch (IOException ioe) {
    +		if (shutdownRequested.compareAndSet(false, true)) {
    +			try {
    +				this.serverSocket.close();
    +			}
    +			catch (IOException ioe) {
     				LOG.debug("Error while closing the server socket.", ioe);
    -		}
    -		try {
    -			join();
    -		} catch (InterruptedException ie) {
    -			LOG.debug("Error while waiting for this thread to die.", ie);
    -		}
    +			}
    +			try {
    +				join();
    --- End diff --
    
    What does this join do? I'm at a loss here.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73859776
  
    The problem is totally deterministic when shutting down the job/task managers.
    
    I've fixed it here: https://github.com/uce/incubator-flink/tree/flink-1492-fix_exceptions_really
    
    @StephanEwen, if this is blocking the release vote, we should just merge my change and not wait for your changes in master, which touch the blob store.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73500870
  
    This change is also in 0.8 so do we need to apply the fix there as well for the upcoming 0.8.1 release?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73699086
  
    I'll merge the change.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by mxm <gi...@git.apache.org>.
Github user mxm commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73855452
  
    I still get 
    
        05:26:08,841 ERROR org.apache.flink.runtime.blob.BlobServer  - Error during shutdown of blob service via JVM shutdown hook: Shutdown in progress
        java.lang.IllegalStateException: Shutdown in progress
    	at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
    	at java.lang.Runtime.removeShutdownHook(Runtime.java:239)
    	at org.apache.flink.runtime.blob.BlobServer.shutdown(BlobServer.java:220)
    	at org.apache.flink.runtime.blob.BlobUtils$1.run(BlobUtils.java:210)
    	at java.lang.Thread.run(Thread.java:745)
    
    On the last night's master.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73856074
  
    OK, thanks for reporting this. @StephanEwen has some pending changes to the blob manager and he will look into it as well.
    
    It is not allowed to remove the shutdown hook when a shutdown is already in progress.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/376#discussion_r24403795
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServer.java ---
    @@ -196,23 +199,28 @@ public void run() {
     	 */
     	@Override
     	public void shutdown() throws IOException {
    -
    -		this.shutdownRequested = true;
    -		try {
    -			this.serverSocket.close();
    -		} catch (IOException ioe) {
    +		if (shutdownRequested.compareAndSet(false, true)) {
    +			try {
    +				this.serverSocket.close();
    +			}
    +			catch (IOException ioe) {
     				LOG.debug("Error while closing the server socket.", ioe);
    -		}
    -		try {
    -			join();
    -		} catch (InterruptedException ie) {
    -			LOG.debug("Error while waiting for this thread to die.", ie);
    -		}
    +			}
    +			try {
    +				join();
    --- End diff --
    
    It's from the old code and I am not sure if it really needs to stay, but it ensures that the BlobServer thread really finishes when calling the shutdown method (BlobServer is a Thread and because the join is called from outside of the run method it waits for the BlobServer thread to finish).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-1492] Fix exceptions on blob store shut...

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the pull request:

    https://github.com/apache/flink/pull/376#issuecomment-73678581
  
    LGTM except for my single question.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---