[SERVER-10825] mongod debug output when closing a batch of connections from Java API doesn't decrement number of connections Created: 19/Sep/13  Updated: 25/Jul/17  Resolved: 25/Jul/17

Status: Closed
Project: Core Server
Component/s: Diagnostics, Networking
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Keenon Werling Assignee: Henrik Edin
Resolution: Done Votes: 0
Labels: connection
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS 10.8.3, Java 7 (1.7.0_40-b43), MongoDB 2.4.6, Tomcat 7.0.42


Issue Links:
Duplicate
is duplicated by SERVER-17797 opened connection count in "end conne... Closed
Operating System: OS X
Sprint: Platforms 2017-08-21
Participants:

 Description   

This isn't critical at all, just a heads up:

I'm sharing a single MongoClient across every Servlet on my Tomcat webapp, as per documentation. I manage the MongoClient inside a ServletContextListener, which creates inside contextInitialized(), and closes inside contextDestroyed().

When I run Tomcat, repeatedly hit my servlet (which gets the MongoClient form getServletContext.getAttribute()), and then Ctrl+C the Tomcat instance when I'm done testing, the log output I get is:

Thu Sep 19 11:24:47.045 [initandlisten] connection accepted from 127.0.0.1:49507 #37 (1 connection now open)
Thu Sep 19 11:24:52.952 [initandlisten] connection accepted from 127.0.0.1:49508 #38 (2 connections now open)
Thu Sep 19 11:24:53.185 [initandlisten] connection accepted from 127.0.0.1:49509 #39 (3 connections now open)
Thu Sep 19 11:24:53.663 [initandlisten] connection accepted from 127.0.0.1:49518 #40 (4 connections now open)
Thu Sep 19 11:24:53.881 [initandlisten] connection accepted from 127.0.0.1:49520 #41 (5 connections now open)
Thu Sep 19 11:24:54.100 [initandlisten] connection accepted from 127.0.0.1:49521 #42 (6 connections now open)
Thu Sep 19 11:24:54.289 [initandlisten] connection accepted from 127.0.0.1:49522 #43 (7 connections now open)
Thu Sep 19 11:24:54.505 [initandlisten] connection accepted from 127.0.0.1:49523 #44 (8 connections now open)
Thu Sep 19 11:24:54.865 [initandlisten] connection accepted from 127.0.0.1:49524 #45 (9 connections now open)
Thu Sep 19 11:25:08.343 [conn41] end connection 127.0.0.1:49520 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn43] end connection 127.0.0.1:49522 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn45] end connection 127.0.0.1:49524 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn44] end connection 127.0.0.1:49523 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn40] end connection 127.0.0.1:49518 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn39] end connection 127.0.0.1:49509 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn38] end connection 127.0.0.1:49508 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn42] end connection 127.0.0.1:49521 (8 connections now open)
Thu Sep 19 11:25:08.343 [conn37] end connection 127.0.0.1:49507 (8 connections now open)

You notice that the number of connections open doesn't decrement after the first close. It does reset on the next use, however, back to

Thu Sep 19 11:36:47.538 [initandlisten] connection accepted from 127.0.0.1:49778 #46 (1 connection now open)
Thu Sep 19 11:36:53.030 [initandlisten] connection accepted from 127.0.0.1:49780 #47 (2 connections now open)

etc.

Didn't look at the source code, but this looks like a synchronization issue.

Cheers,
Keenon



 Comments   
Comment by Henrik Edin [ 25/Jul/17 ]

Old issue and could not reproduce, closing as gone away.

Comment by Jeffrey Yemin [ 19/Sep/13 ]

I'm going to move this to the SERVER project.

Generated at Thu Feb 08 03:24:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.