Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TOREE-548] Call shutdown to close ZQM Context in ZeroMQSocketRunnableSpec #214

Merged
merged 4 commits into from
Aug 10, 2023

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Aug 10, 2023

This is the third attempt to fix the test hang issue ...

"pool-5-thread-1-ScalaTest-running-ZeroMQSocketRunnableSpec" #76 prio=5 os_prio=0 tid=0x00007efcd5e53000 nid=0x54954 runnable [0x00007efc2effb000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
	- locked <0x00000006f93f8448> (a sun.nio.ch.Util$3)
	- locked <0x00000006f93f8430> (a java.util.Collections$UnmodifiableSet)
	- locked <0x00000006f8c1f180> (a sun.nio.ch.EPollSelectorImpl)
	at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
	at zmq.Signaler.waitEvent(Signaler.java:166)
	at zmq.Mailbox.recv(Mailbox.java:91)
	at zmq.Ctx.terminate(Ctx.java:302)
	at org.zeromq.ZMQ$Context.term(ZMQ.java:671)
	at org.zeromq.ZMQ$Context.close(ZMQ.java:779)
	at org.apache.toree.communication.socket.ZeroMQSocketRunnableSpec.$anonfun$new$3(ZeroMQSocketRunnableSpec.scala:65)
	at org.apache.toree.communication.socket.ZeroMQSocketRunnableSpec$$Lambda$9113/65813533.apply$mcV$sp(Unknown Source)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.util.Try$.apply(Try.scala:213)
	at org.apache.toree.communication.socket.ZeroMQSocketRunnableSpec.$anonfun$new$2(ZeroMQSocketRunnableSpec.scala:65)
	at org.apache.toree.communication.socket.ZeroMQSocketRunnableSpec$$Lambda$8887/1440611680.apply(Unknown Source)
	at org.scalatest.BeforeAndAfter.$anonfun$runTest$1(BeforeAndAfter.scala:219)
        ...

It uses reflection to call Ctx#shutdown to skip waiting DONE message

Command cmd = termMailbox.recv(WAIT_FOREVER);

So in theory, it could solve the hang problem thoroughly (maybe ...

@lresende lresende merged commit 9e408a3 into apache:master Aug 10, 2023
2 checks passed
@pan3793
Copy link
Member Author

pan3793 commented Aug 10, 2023

Nice, the CI of recent commits on the master branch is green now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants