Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Threading model (was Re: Jetty 12 schedule?_
  • From: "Cantor, Scott" <cantor.2@xxxxxxx>
  • Date: Thu, 10 Nov 2022 01:28:47 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 128.146.163.16) 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=QaSC0g+S8SguSYOPUc4AXEXN/H6VveZlyM/nFYjGdl8=; b=nW+7XYDZgk8WtVWFLbhvAYdil1l7WGZxR0oLpLA/u2ETRyOeargQgikYyA7KKFSbyoJw1ZIrPmGEvzZDz45sLDQ4LL8ma4V4hzMumlWWvpgFJkTxu+QuvlzHTnJy9T6k88fqpjfzUarxX2yUe/O2195PnH2FCjSpU3wl/t7xr3cWGuspIx87N8A9bKYGaSn1BuQLa0COxlrwrhn2sv0WUUhDGelENMKTKZuKgwopPsR6HZ4ZJIBtuVz6ucgRHbqRpK8ycdNqeLSt7dVTErBJEYbVAMg14bI5bfr1e0GS10l9AWf5/5RhMHVBoS/0g/uvM2Br6GoewSB6RUzc17ZcfA==
  • 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=QaSC0g+S8SguSYOPUc4AXEXN/H6VveZlyM/nFYjGdl8=; b=k2ff4jPo46LjIMabY0TmiFLlUgIJPsSnrrQSCow+S6hqSSmyqNziqheAUNxGwwz6BxBLsvqg5RFLNNm0M9qZC2M4BQ1oy5F0XNaglPlpdoTKRJ0h4kqV7JnJfb8759mjKLUPOu4IyJwujeskFJBUF+9ocNll9HaaMCc7LLFQFlpi5obbdmjiwRjR8K1ijzorm/NRDxvkcn/aK57eJ/EPUp2cZqBLid+CSFH89P8C/7zcNyG8Y7Lx/UxqyX9ADzFSmhlijk1zC2XT57NBONAT1PnpHdVLm4miOzKQ7IyFf+IvXt+u7agPI90lxRIRRG/DbRV3kReTsucw3EkUI81KiA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=CYRauqYNMYVMJjd44UfzIaW6dHFgtQrdbkH3pDs2lHBgGr6jfLTsBBpmj1ubO07GCtVp0O9qQanmbeY9Lc7sCzkkhR7WTB6oz+Aj+lDC/APL/07/hQu/EVLfXCTRno+H92bg0uqWZmcf4xp8bL88qpZ9r44Jk/PL1xODrqKj1EUu/NTi7EEvroWZFl0tSjnWUsVrwA+BM4S4M0VBg/Kv+ylWE191sAM+mu2Bw7Vy2Xx438/SaaYfXdFNRjKPjHscAGzGqeTIxgg+oj4slHOVFpeneohOLHGyTkrwoUqxLwlgBDqsYZFZ5Ekx7Czi/01R0Hd5PGE6zdY3Y/XaUlfLiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJ7wqfdunJ9vQlpLIsmnP7qSV0vYpBA8i/vDjXl/ZCBya/fUJp2RhNVf4wRl8nrrvup3Qe9j9LlKPcuCf/ec5lz3sVJOoId8IMMHUS7HoEfjyezMMJ06QPPsPHIM2y4SMqSJXMD0oxyZrfrKDuICGEfKucrqRzQr6cZLS/WPV1PDtCb12LSZ9bYrZQZopvVqqDca3YgidVvkDhEXB8a0JBlceozjzU8a+kf+lvGauvC87Yx+gu7Qbbu6CCiHEYGV2ahNL+weif4lE5SqHxXtXAAlC7Ji4IHHsXnt2BhaLgQ8Yatx3sqHu5AIXdIm5RaQeZqGd6DoLZEwFNtmSvzEeg==
  • 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: AQHY9J6Oj64MyBctz0SBYEVoDJxEIq43Cn4A
  • Thread-topic: [jetty-users] Threading model (was Re: Jetty 12 schedule?_
  • User-agent: Microsoft-MacOutlook/16.66.22102801

>    The assumption that you'll be passed a HttpServletRequest and/or
> HttpServletResponse to these actions isn't 100% true.

Ok, I can see that.

>    Take for example the Async I/O events.

Which we will never, ever call/use/allow.

>    There are similar things elsewhere in the spec.

Most of them are in the same bucket, we don't do that kind of thing.

>  Keep in mind that there is no provision in the Servlet spec for notifying
> of the lifecycle of the HttpServletRequest or HttpServletResponse
> objects.

Understood, but they have to exist for the lifetime of the call to the servlet dispatch method, absent use of other container services that interrupt the processing chain of that method, no? Otherwise it's madness since we couldn't even make it work by passing them around if we wanted to.

>    The proper way is to use the request / response objects as passed to
> you, and not hold onto them.

That would imply that one has to immediate extract every possible bit from them and construct a new façade for the data before one's servlet method even calls another object. That's a pretty huge step backward, if true.

> As a servlet endpoint, you are expected to get what you need from the
> request (headers, body, etc), formulate a response (status code,
> headers, etc) and then produce a body.

Of course, but that is never (outside trivial samples) one class. It's a chain of many objects and methods doing work. You don't pass the interfaces into every method.

And even if you did pass them into every method in a synchronous call chain, you're implying that wouldn't even help. And that seems impossible since I can't even see how you would ever be in the middle of the code to interfere with it.

Again, there is no use of async anything whatsoever (once we get control), and there never will be. For exactly this reason.

>    If you need to track things between dispatches of the same exchange,
> it's usually a good idea to use the request attributes to hold onto objects
> for the scope of that one request.

If I have no HttpServletRequest, how would I possibly put or get them? That doesn't change the situation, really.

>    Don't forget about normal redispatch behavior.

That's worth more study, especially the error case, but that's likely past the point we'd be doing anything unusual depending on these interfaces. But it is a point we need to consider.

>    Imagine if the APIs contained the request/response objects
> everywhere, which ones do we give you if wrapping occurs? (eg: if a
> Filter wrapped the request, and added the listener, then the Servlet
> wrapped again, and then that listener needed to fire, do we give you the
> servlet wrapped request or the filter wrapped request?)

Yes, I can see why they had to do things the way they did for the Async APIs. Which we don't use.

-- Scott



Back to the top