Skip to content

HIVE-29635: HS2 WebUI "Start Time" shows current time on every refresh#6513

Open
magnuma3 wants to merge 1 commit into
apache:masterfrom
magnuma3:fix-hs2-starttime
Open

HIVE-29635: HS2 WebUI "Start Time" shows current time on every refresh#6513
magnuma3 wants to merge 1 commit into
apache:masterfrom
magnuma3:fix-hs2-starttime

Conversation

@magnuma3
Copy link
Copy Markdown

HIVE-29635

What changes were proposed in this pull request?

Move hiveConf.set("startcode", ...) to before builder.setConf(hiveConf) in HiveServer2#createHttpServerBuilder. One-line move.

Why are the changes needed?

HttpServer.Builder#setConf defensively copies the conf into the servlet context. The previous code wrote startcode after the copy, so the JSP reading from the copy never saw it and fell through to its System.currentTimeMillis() default — making the WebUI "Start Time" advance on every refresh.

Does this PR introduce any user-facing change?

Yes. WebUI "HiveServer2 Start Time" now shows the actual server start time and stays stable across refreshes.

How was this patch tested?

@sonarqubecloud
Copy link
Copy Markdown

when(cli.getSessionManager()).thenReturn(sessionManager);

long before = System.currentTimeMillis();
Thread.sleep(1000);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do you need sleep here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not just compare builder startcode with one set in root conf object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants