{"action":"closed","issue":{"url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/52","labels_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/52/comments","events_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/52/events","html_url":"https://github.com/vert-x3/vertx-mongo-client/issues/52","id":114233780,"number":52,"title":"Result handlers not run on calling vertx context","user":{"login":"gokl","id":5765178,"avatar_url":"https://avatars.githubusercontent.com/u/5765178?v=3","gravatar_id":"","url":"https://api.github.com/users/gokl","html_url":"https://github.com/gokl","followers_url":"https://api.github.com/users/gokl/followers","following_url":"https://api.github.com/users/gokl/following{/other_user}","gists_url":"https://api.github.com/users/gokl/gists{/gist_id}","starred_url":"https://api.github.com/users/gokl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokl/subscriptions","organizations_url":"https://api.github.com/users/gokl/orgs","repos_url":"https://api.github.com/users/gokl/repos","events_url":"https://api.github.com/users/gokl/events{/privacy}","received_events_url":"https://api.github.com/users/gokl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"purplefox","id":701906,"avatar_url":"https://avatars.githubusercontent.com/u/701906?v=3","gravatar_id":"","url":"https://api.github.com/users/purplefox","html_url":"https://github.com/purplefox","followers_url":"https://api.github.com/users/purplefox/followers","following_url":"https://api.github.com/users/purplefox/following{/other_user}","gists_url":"https://api.github.com/users/purplefox/gists{/gist_id}","starred_url":"https://api.github.com/users/purplefox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purplefox/subscriptions","organizations_url":"https://api.github.com/users/purplefox/orgs","repos_url":"https://api.github.com/users/purplefox/repos","events_url":"https://api.github.com/users/purplefox/events{/privacy}","received_events_url":"https://api.github.com/users/purplefox/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/milestones/2","html_url":"https://github.com/vert-x3/vertx-mongo-client/milestones/3.2.0","labels_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/milestones/2/labels","id":1278005,"number":2,"title":"3.2.0","description":"Part of the 3.2.0 Release train.  Note Semantic versioning may not be strictly applied as we are governed by the vertx-core project.","creator":{"login":"karianna","id":180840,"avatar_url":"https://avatars.githubusercontent.com/u/180840?v=3","gravatar_id":"","url":"https://api.github.com/users/karianna","html_url":"https://github.com/karianna","followers_url":"https://api.github.com/users/karianna/followers","following_url":"https://api.github.com/users/karianna/following{/other_user}","gists_url":"https://api.github.com/users/karianna/gists{/gist_id}","starred_url":"https://api.github.com/users/karianna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karianna/subscriptions","organizations_url":"https://api.github.com/users/karianna/orgs","repos_url":"https://api.github.com/users/karianna/repos","events_url":"https://api.github.com/users/karianna/events{/privacy}","received_events_url":"https://api.github.com/users/karianna/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":9,"state":"open","created_at":"2015-08-28T17:40:41Z","updated_at":"2015-11-09T11:06:05Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-10-30T09:40:04Z","updated_at":"2015-11-09T11:06:05Z","closed_at":"2015-11-09T11:06:05Z","body":"Hi,\r\n\r\nit seems to me that the result handlers for the several methods in MongoClient.java / MongoClientImpl.java are not being run on the context of the calling thread, i.e. the eventloop.\r\n\r\nInstead the call to vertx.runOnContext creates a new context for the thread the result handler runs in (mongo client threads). This causes the result handlers to run on a different thread than the verticles eventloop and makes the handlers run in parallel.\r\n\r\nIs this wanted behavior? It caused me some race condition headache because i thought the result handlers would run on the same eventloop (and thread)..\r\n\r\nA solution would be to save the context of the calling thread via vertx.getOrCreateContext() and use that context for runOnContext() in the several result handler wrappers.\r\n"}}