简体   繁体   English

停止后Jetty服务器离开线程

[英]Jetty server leaves behind threads after stop

I am working at a Scala project that used Jetty to serve webpages generated by a Scalatra servlet. 我在一个使用Jetty服务Scalatra servlet生成的网页的Scala项目中工作。

I am having troubles stopping the server. 我在停止服务器时遇到了麻烦。 It shutdowns, but it leaves behind some threads that prevent my application from closing. 它会关闭,但会留下一些线程,阻止我的应用程序关闭。

This is how I instantiate the server: 这就是我实例化服务器的方式:

val server = new Server(8080)
val context = new WebAppContext()
context.setResourceBase("visualization")
context.addServlet(new ServletHolder(new CallTreeServlet(data)), "/callTree/*");
context.addServlet(new ServletHolder(new DataLoadingServlet(data)), "/data/*");
server.setHandler(context)
server

I start and stop it using the corresponding methods from the sbt console. 我使用sbt控制台中的相应方法启动和停止它。 When I stop the server it correctly does not serve the pages anymore, but my application is still running because of some threads sill running. 当我停止服务器时,它不再正确地提供页面服务,但是由于某些线程仍在运行,我的应用程序仍在运行。

Is there any way to force jetty and all its threads to stop? 有什么方法可以迫使码头及其所有线程停止航行?

You can find the complete log of the errors I get after the shutdown operation here 您可以在此处找到关闭操作后收到的错误的完整日志

Do you have a thread dump to say what threads are still running? 您是否有线程转储来说明哪些线程仍在运行?

Note that this kind of thing is probably better reported in a bugzilla report rather than at stackoverflow. 请注意,这种情况最好在bugzilla报告中报告,而不是在stackoverflow上报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM