Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:27:27+00:00 2026-05-31T16:27:27+00:00

I am using FindAndModify in MongoDB in several concurrent processes. The collection size is

  • 0

I am using FindAndModify in MongoDB in several concurrent processes. The collection size is about 3 million entries and everything works like a blast as long as I don’t pass a sorting option (by an indexed field). Once I try to do so, the following warning is spawned to the logs:

warning: ClientCursor::yield can't unlock b/c of recursive lock ns: test_db.wengine_queue top: 
{ 
opid: 424210, 
active: true, 
lockType: "write", 
waitingForLock: false, 
secs_running: 0, 
op: "query", 
ns: "test_db", 
query: { 
    findAndModify: "wengine_queue", 
    query: { 
            locked: { $ne: 1 }, 
            rule_completed: { $in: [ "", "0", null ] }, 
            execute_at: { $lt: 1324381363 }, 
            company_id: 23, 
            debug: 0, 
            system_id: "AK/AK1201" 
        }, 
    update: { 
            $set: { locked: 1 } 
        }, 
    sort: { 
            execute_at: -1 
        } 
}, 
client: "127.0.0.1:60873", 
desc: "conn", 
threadId: "0x1541bb000", 
connectionId: 1147, 
numYields: 0 
}

I do have all the keys from the query indexed, here they are:

PRIMARY> db.wengine_queue.getIndexes()
[
{
    "v" : 1,
    "key" : {
        "_id" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "_id_"
},  
{
    "v" : 1,
    "key" : {
        "system_id" : 1,
        "company_id" : 1,
        "locked" : 1,
        "rule_completed" : 1,
        "execute_at" : -1,
        "debug" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "system_id_1_company_id_1_locked_1_rule_completed_1_execute_at_-1_debug_1"
},  
{
    "v" : 1,
    "key" : {
        "debug" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "debug_1"
},
{
    "v" : 1,
    "key" : {
        "system_id" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "system_id_1"
},
{
    "v" : 1,
    "key" : {
        "company_id" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "company_id_1"
},
{
    "v" : 1,
    "key" : {
        "locked" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "locked_1"
},
{
    "v" : 1,
    "key" : {
        "rule_completed" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "rule_completed_1"
},
{
    "v" : 1,
    "key" : {
        "execute_at" : -1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "execute_at_-1"
},
{
    "v" : 1,
    "key" : {
        "thread_id" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "thread_id_1"
},
{
    "v" : 1,
    "key" : {
        "rule_id" : 1
    },
    "ns" : "test_db.wengine_queue",
    "name" : "rule_id_1"
}
]

Is there any way around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:27:29+00:00Added an answer on May 31, 2026 at 4:27 pm

    For those interested — I had to create a separate index ending with the key that the set is to be sorted by.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using Rails 3.2.0 with haml and sass: I Would like to link an external
using grep, vim's grep, or another unix shell command, I'd like to find the
Using AddRange in a ListView When you have a custom collection and want to
Using Ninject i would like to rebind one method to another implementation is that
Using PHP, what is the best way to store special characters (like the following)
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.