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 12:53:23 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 128.146.138.10) 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=Ia43M51avpA3XCzKRgBNDRQaXhspiaF05zpxRrGtfgg=; b=BB+974wDL+g4owjvJgnMlZJEiT8BRQXpk7U2EuBgqWnZ4wS/i7yptqGWFwn+cXDx802r2lcvalA/j2vuaA0S7SP4dK6lsSDIgGqte8EDiAGBnQMjCFGvE7ztP5nw/RJUFEb7Ce2xa+D3f/zn39I7FuR7yOpSgsQHTQaPCwezZnqdRj6+Ij2gTVvtAGstOujOVtaNRIKpMc8HrXoMckmhaeaj8KRcMiCQak5uHlNLB/9yhsPVLOR533mlnUANp+nfJbc8YFUM6ukC+KoXXv0BtEZqxvTnnx44HqD4rag5qYt5W/wMAHCYdkRQZtvjYeB11h9rM6BQtrwaImjFNAv4Gw==
  • 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=Ia43M51avpA3XCzKRgBNDRQaXhspiaF05zpxRrGtfgg=; b=eFVmuMPCOCj/n43aG/2zv5Lsf/YQFbcYVr/xTuXIAmKzvk2EYQeyxseBDsgVjEMZI1faqSGy+UoLeb7rXka4/B73t7uhO4gX0JkrYoOdwWOR8ZTKw2jfFlwfcPLhsrh5LNJQXNnXsY9dKRffhmx3fvY7uCFv9MzPT35BQQWnlWP9ClBxuBIsPjQOb/UD3IDv1fZyf+ot4imtZYTw1Yka2zjhS1APhox7fcFjbsh8s/BpkEADKTY74UG5xs+NJdsoJ3GX48lqf5NQZqNDwYlig2c1KZ81bpIkeVHnKWobA3vkq4Vv8AVl7YOD+9WzFcWRT2Sp3bwStwrWi0iOFHub5A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=kj9RFOS9WrDyQN21V4AXt1aNzr6PLmbX+ir/YNQY1U7ET2000AJPyYaWWxR3euc4rTrI6cnMZJgy9C2xnfXnEUzuNtH4GZ8OvT8uaqxTXQ/iBWcJNJfGFEp+uJE3TZoGwmbothLV/LZkH2g7sQddX2y+veMi9ai8u/nqn+ct2P39/XK7Iildqd+Ko9KYJ8inbreFaeHOqvFlK/DISmQNviCByrbWvrVyLSMGTwQsDSJjq4waXDTlbx9kGq4l9I1ENLXpl/WQ1EUiaEFxi3bIdiBs2GBFRPxoRlp+RP0FWXll3DnmBbzpLMzgHGgZycgk4ghKJUaiRwkDnaL1iqxr8w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X3VVFH3/mILU1738nkrVh+fro9gnTt0WzOEgXH/2X/gHhxdiwCph67cweeEXLD5cEyYx0HtXfvtHshadFK8cmtmJ7UwuJCwOuqZ5SituYS/u1cxNd/1BIi1b5MNTPb9ZcSk8pUq7HmTuRqwuAgjqOEygCQOJ8a9gsumfkflOHKFIShNZDxs5Ab3kWdR4DmiM068m0CeDCX8Y8NnNUZyaErA4JJrLaMe5udGF0Eef0nUkJopuWwUXI95x3vTDWT+2HtrYCkvSDdc9fmgBAwyM2nx2ID9WdzK5Tl27SUGwGctpeZyWYHPvdZhEZb8dSi1Fzgs3ymC8hBjX6YajUpGhLg==
  • 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: AQHY9J6Oj64MyBctz0SBYEVoDJxEIq43Cn4AgABezwCAAGB5gA==
  • Thread-topic: [jetty-users] Threading model (was Re: Jetty 12 schedule?_
  • User-agent: Microsoft-MacOutlook/16.66.22102801

>    Problems start to occur when a request/response is wrapped in
> another object that abstracts away from the request response paradigm
> and just looks like some dataful object (which just happens to be backed
> by data a request).   Such objects can easily be put into persistent data
> structures that have no lifecycle relationship to the original request.

Yes. We actually changed a lot of properties on singletons from taking an HttpServletRequest to Supplier<HttpServletRequest> precisely because while *we* know we're not injecting an actual request object but rather a proxy for one, it's not obvious from the code. That was not good.

But they were never being given an actual request. Only a proxy for retrieving the "current" one. The hitch is how one can know what the current one is across a call stack and that's where we used thread-locals.

But we have never had any lifecycle problems, because we populate the thread-locals from a filter and the filter clears them during the unwind, and it's never caused any trouble.

What we're concerned about is the drumbeat that a non-async-using servlet request that's just executing methods on objects via the stack could start out on one thread and switch threads in the middle. And I just don't see how that's remotely possible or sane. And if it is, the spec went to a very bad place and a lot of software is screwed, not just ours.

-- Scott



Back to the top