Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Threading model (was Re: Jetty 12 schedule?_
  • From: "Cantor, Scott" <cantor.2@xxxxxxx>
  • Date: Wed, 9 Nov 2022 23:22:04 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 128.146.163.15) smtp.rcpttodomain=eclipse.org smtp.mailfrom=osu.edu; dmarc=pass (p=none sp=none pct=100) action=none header.from=osu.edu; dkim=pass (signature was verified) header.d=osu.edu; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=osu.edu] dkim=[1,1,header.d=osu.edu] dmarc=[1,1,header.from=osu.edu])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=osu.edu; dmarc=pass action=none header.from=osu.edu; dkim=pass header.d=osu.edu; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lqoLS73AD6OrHSbmwQaThyg7cUNJvT0avzMOJBWolsA=; b=ktYBIycaHhE6udwWQfxqrJDD5wyfyUSpA16BiVgXG8NB0i1RmO8lipCG+tVUTtPjZ4NdiNqEO9hB0qr3zWI9/U32F2lQrkqFsNuaWVU5A9Qkmr1vLeT+JnjsciCU15+dHaJpZ1Y03RA+SGCOG6CjLWWwPcSA7fZ8knjLVgK1pEZOQb+bBBdiytCAdsHTP6pL7KG8/e3sCn+ZwBR5ukBD9irS9n7aOszB6cK9gNbWGsz7XNYjYQ4fluGb5bjsrmxQQB/tUrFBht0l6BAL69IGC7vKsH2EfgCoqhbihYgzBp6NVErOX3DFfdFEYKdwd7d1z/N7k8HMJBv1a8tvKkkkSQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lqoLS73AD6OrHSbmwQaThyg7cUNJvT0avzMOJBWolsA=; b=Laeczvr4gOA6drhOiWpZ2fBB3iil305EhRdMPkWIiTkjC7+IM3m9CXpULfCpbnA67R7BH6Jzr968pyIbeg0uSLh1TlqS1YqD1+nu424zv8Wo4gDRhcQP9N4WySOtyB8IjFgScrYJIbCZ8UV/tekeQKYy3KlN9l29lUEvgb7oyMLASGcoXB3ERsQ5zbVYfIgScfGCNmlIZoBYUEJHI2Pim0HUjDJHj9zI5vFoW2m3ZH/9X18QoGNH7cKDsMQ5mwWFcMgBM2FINQZBPWTScEJDBLwFJkv8vaiu97cDS1qFBETH0bnB488bJtdomuuCuK+BVuY2FcXIOO5H48M21fwxOg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SEz78NB7BBHYfcVIAt+/gU0K3cnuguveYBo7u3IU3fZ+NgFYWr/KiKjjQUKs3dqKMWJdN25vzeVnWcmlYHi/rQCXxbnLcGeiRKYT2cgLLHOiHvzUV1ZDOfCP/R3lUu6AZEgB3c7bqH/1vDjsj+5gIiKEgpnu+K/VOyHPWYGnr7H9hBMoMEBiiMEm+XI+MD5QGkvLwAO1GUADNnXH0EUmkKb5wCQIFXWxi0A8TUP9ej1AWBquxyAujctw++Hh9awChgjsCAUpy1K9QVakMxlNPIsmwWA4H3pqpb0ecGQ+Kl3We3LDfURcgSgqskM+d8GqiFPYlIUvFw1G8Qoc3BvD/Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXUOU7bqpxD5TQ+CFmivy+I3181FyZZ/j9wP5zunHaO099Cc5oSXzCz7z95bW2GV6pxD8Lb/N29In3cF0Zqhc3VFzHvF8Vey59A54mFchOwi2Zv8qefQ27ljJwPlYfapguCCQa1jp+1rlWR0SM6mYHqJo07Uip14/eBvkaSvGW23+Pjiqpp23QoLOfpr5Yl0hKitMfAzcCAYA69e/VDMbl2Z/5yqJFRxk+WmAXDVYNhn4rCjSenzh5J8IS29SjaXF9mwlFfxYXCxF//IV3vu31Sfz7sn7eOEYLbQD2XLuGAqiOs/Ue75mNPLLt1T1YNFyttTIGHgk7AadTeItfbfcQ==
  • Delivered-to: jetty-users@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jetty-users/>
  • List-help: <mailto:jetty-users-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHY9JITon6wmvPSLUeQwOLVH+bG4w==
  • Thread-topic: Threading model (was Re: [jetty-users] Jetty 12 schedule?_
  • User-agent: Microsoft-MacOutlook/16.66.22102801

    >    It's a general anti-pattern to hold onto, use, reference a
    > HttpServletRequest or HttpServletResponse object outside of the
    > dispatch from the container.

One more question about this I guess...

Is it fair to assume that the only way a request could possibly cross threads like that is if there's also an actually explicit entry point into one's application logic by which the container is actually invoking a standard interface that is defined to accept the HttpServletRequest/Response?

In other words, I take your point that people can build code that leverages various advanced async/etc. features in the servlet spec, and we don't necessarily know that's happening, but it has to *be* some explicit invocation of a container technology that in turn is going to call back in with the "proper" servlet request/response, right?

Otherwise how could one ever know which instance of the request/response interfaces to act on?

All we do is implement servlets (or make use of them) that accept a servlet dispatch call in and respond out. Nothing else in our design implements any servlet APIs that can accept a request/response in a different way.

So it's difficult to understand how we could possibly be passed in a different instance than the original one the servlet dispatch received since there's nowhere for it to occur.

That's why we've struggled to grasp what the risk is as this has come up at times.

I fully appreciate that you're speaking from a container/generality perspective here and that in the general case what you're saying is obviously true. And yes, it's an anti-pattern because it makes assumptions that aren't generally true. I'm strongly suspecting they are, however, still true for us (and frankly for the vast majority of traditional apps that just implement Servlet).

Basically it feels like for this to break, something has to call an API that also involves passing in a callback interface that itself has to receive the request/response back.

-- Scott



Back to the top