Skip to content

Conversation

@sbordet
Copy link
Contributor

@sbordet sbordet commented Oct 2, 2025

  • Deprecated for removal Uptime.
  • Moved ServerMBean.instant to Server.
  • Removed Uptime usages, replaced by using Instant in Server.
  • Removed Uptime usage in AbstractLifeCycle, only used for DEBUG logging.

* Deprecated for removal Uptime.
* Remove its usages, replaced by using Instant in Server.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet self-assigned this Oct 2, 2025
@sbordet sbordet moved this to 👀 In review in Jetty 12.1.3 - FROZEN Oct 2, 2025
@sbordet sbordet linked an issue Oct 2, 2025 that may be closed by this pull request
@sbordet sbordet requested review from gregw and joakime October 2, 2025 08:56
@joakime joakime moved this to 👀 In review in Jetty 12.1.4 Oct 16, 2025
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are merge conflicts

…1.x/3515-remove-uptime

# Conflicts:
#	jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
@sbordet sbordet requested a review from gregw October 17, 2025 16:48
joakime
joakime previously approved these changes Oct 27, 2025
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but it seems like we would have an insignificant bug thru a DST change.

If so, would a negative value cause any bugs?

*/
public long getUptimeMillis()
{
return Duration.between(startupInstant, Instant.now()).toMillis();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this calculation be wrong twice a year during DST changes?

Copy link
Contributor Author

@sbordet sbordet Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in order to fix this we would need to know the ZoneId.
We could use ZoneId.systemDefault(), and modernize Server to have a ZonedDateTime as startup "time", rather than just Instant.
If users want to configure a different timezone for the JVM, they can use the system property user.timezone.

Now the startupTime is a ZonedDateTime, which takes into account daylight savings.

Signed-off-by: Simone Bordet <[email protected]>
lorban
lorban previously approved these changes Oct 30, 2025
Copy link
Contributor

@lorban lorban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if we accept the tiny breakage.

}

@ManagedAttribute("The UTC startup instant")
@ManagedAttribute("The startup date time in the system timezone")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a somewhat breaking change, although not necessarily a bad one.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet merged commit 9194d5d into jetty-12.1.x Oct 31, 2025
3 of 8 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Jetty 12.1.4 Oct 31, 2025
@sbordet sbordet deleted the fix/jetty-12.1.x/3515-remove-uptime branch October 31, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Review Uptime

5 participants