[SERVER-21170] NetworkInterface::startCommand should be able to reject requests due to shutdown Created: 27/Oct/15  Updated: 26/Apr/16  Resolved: 31/Mar/16

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

Type: Improvement Priority: Critical - P2
Reporter: Andy Schwerin Assignee: Waley Chen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Platforms 12 (04/01/16)
Participants:
Linked BF Score: 0

 Description   

In order to allow the ThreadPoolTaskExecutor to issue NetworkInterface::startCommand outside the executor's mutex, it is necessary that startCommand return some indication as to whether or not the network interface takes ownership of the operation.

Proposed behavior:

NetworkInterface::startCommand returns false if NetworkInterface::shutdown has already started, and true otherwise. If it returns true, then the onFinish argument will be executed by NetworkInterface eventually; otherwise, it will not. setAlarm should behave similarly

NetworkInterface::shutdown blocks until callbacks assocated with all accepted commands and alarms have executed. It is OK (preferred?) for shutdown() to cause some or all pending callbacks to execute with a "CallbackCanceled" status in order to expedite shutdown.



 Comments   
Comment by Githook User [ 04/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-21170 NetworkInterface::startCommand should be able to reject requests due to shutdown
Branch: master
https://github.com/mongodb/mongo/commit/6ee50d2d7a762d5dc9b8767e796df97e90f6d0ba

Comment by Githook User [ 01/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: Revert "SERVER-21170 NetworkInterface::startCommand should be able to reject requests due to shutdown"

This reverts commit dfabadb09387a4236ee7675cd02d39b17affaf39.
Branch: master
https://github.com/mongodb/mongo/commit/ace59db31c5f0e12e996f2b67b61f014f20b59fd

Comment by Githook User [ 01/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: Revert "SERVER-21170 NetworkInterface::startCommand should be able to reject requests due to shutdown"

This reverts commit ada50f9f409afdccb40038b3ba182bf4e81e0490.
Branch: master
https://github.com/mongodb/mongo/commit/66f642d25709132cb2840a42aa6adf45844c5f30

Comment by Githook User [ 31/Mar/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-21170 NetworkInterface::startCommand should be able to reject requests due to shutdown
Branch: master
https://github.com/mongodb/mongo/commit/dfabadb09387a4236ee7675cd02d39b17affaf39

Comment by Andrew Morrow (Inactive) [ 28/Oct/15 ]

I'm bumping this out to 3.3 required. I agree that if ThreadPooTaskExecutor already handles this that there is no work we need to do now. However, we may want to use NetworkInterfaceASIO in other contexts in the future, and I'd like to ensure that it offers orderly shutdown.

Comment by Andy Schwerin [ 27/Oct/15 ]

Turns out that ThreadPoolTaskExecutor engages in a safe shutdown procedure wrt this behavior. I don't think this ticket is necessary.

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