Re: How can I see where the sjavac_server is started?

2019-03-05 Thread Magnus Ihse Bursie




On 2019-03-01 19:36, Jonathan Gibbons wrote:



On 03/01/2019 05:32 AM, Magnus Ihse Bursie wrote:


I think we should really get rid of sjavac since the relevant 
benefits are already present in the default build, with the javac 
server and the dependency plugin. The only possible benefit of 
sjavac today would be more fine grained incremental build support, 
but I doubt it works very well given that it's not being maintained.


Agree. I opened https://bugs.openjdk.java.net/browse/JDK-8219973.

/Magnus


Magnus, et al,

Be careful. There is as yet no "javac server".  The server mechanism 
is currently only available within sjavac.


There is a desire/goal to provide a "javac server". When first 
suggested, it was considered blocked by the need of some 
platform-specific features in the main `java.util.Process` API. 
However, when the core-libs team looked at the RFE, it was not clear 
that the work was actually required. The issue is the ability to 
create a process that can outlive the parent; at one point, it was 
believed that this was not easy/possible with existing Java API on all 
necessary platforms (i.e all platforms supported by the build.)


Jon,

Your warning is noted. What I meant was that the build system currently 
has two ways of providing javac server speedups, one of which works well 
and is on by default, and one which has not been tested for a long time. 
We should remove that option from the build system. I did not intend to 
go into the finer details of what "really" consitutes sjavac.


/Magnus



-- Jon




Re: How can I see where the sjavac_server is started?

2019-03-01 Thread Jonathan Gibbons




On 03/01/2019 05:32 AM, Magnus Ihse Bursie wrote:


I think we should really get rid of sjavac since the relevant 
benefits are already present in the default build, with the javac 
server and the dependency plugin. The only possible benefit of sjavac 
today would be more fine grained incremental build support, but I 
doubt it works very well given that it's not being maintained.


Agree. I opened https://bugs.openjdk.java.net/browse/JDK-8219973.

/Magnus


Magnus, et al,

Be careful. There is as yet no "javac server".  The server mechanism is 
currently only available within sjavac.


There is a desire/goal to provide a "javac server". When first 
suggested, it was considered blocked by the need of some 
platform-specific features in the main `java.util.Process` API. However, 
when the core-libs team looked at the RFE, it was not clear that the 
work was actually required. The issue is the ability to create a process 
that can outlive the parent; at one point, it was believed that this was 
not easy/possible with existing Java API on all necessary platforms (i.e 
all platforms supported by the build.)


-- Jon


Re: How can I see where the sjavac_server is started?

2019-03-01 Thread Andrew Haley
On 2/27/19 3:51 PM, Erik Joelsson wrote:
> The server is started lazily by the first javac invocation that needs 
> it. There is a parameter given to javac that describes how it should be 
> started, but to get the exact command line, you would have to instrument 
> javac java source. You should be able to add additional parameters to 
> that JVM, at least by editing spec.gmk, that could help you with 
> diagnostics.

Aha! Yowza, that's obscure. :-)

Thanks everyone for your help. I did discover startserver by stracing, just as 
you
suggested.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. 
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


Re: How can I see where the sjavac_server is started?

2019-03-01 Thread Magnus Ihse Bursie

On 2019-02-27 16:51, Erik Joelsson wrote:

Hello Andrew,

On 2019-02-26 12:09, Andrew Haley wrote:

I'm seeing a crash in the javac server while building openjdk.

We are seeing this too intermittently.

I want to run the exact same command that started the server running,
but even with LOG=debug I cannot find the command line that starts
it. The command seems not to be there at all.

So, how exactly does the javac server get started, and how do I find
the command line that started it?
The server is started lazily by the first javac invocation that needs 
it. There is a parameter given to javac that describes how it should 
be started, but to get the exact command line, you would have to 
instrument javac java source. You should be able to add additional 
parameters to that JVM, at least by editing spec.gmk, that could help 
you with diagnostics.

And, incidentally, given that I'f configured with --disable-sjavac,
why is the build running a javac server? Thanks.

The "smart javac" and the javac server are not one the same. The 
server was introduced in sjavac, but the server part was later ported 
over to javac proper (I think). So now we have two configure 
arguments, --enable-sjavac and --disable-javac-server. The latter is 
what you are looking for.


I think we should really get rid of sjavac since the relevant benefits 
are already present in the default build, with the javac server and 
the dependency plugin. The only possible benefit of sjavac today would 
be more fine grained incremental build support, but I doubt it works 
very well given that it's not being maintained.


Agree. I opened https://bugs.openjdk.java.net/browse/JDK-8219973.

/Magnus



/Erik





Re: How can I see where the sjavac_server is started?

2019-02-27 Thread Jonathan Gibbons
What Erik stated regarding javac and sjavac is not entirely correct: 
currently, javac does not itself support starting a background server, 
although that is a goal that we (javac team) would like to achieve.


Instead, it is the case that sjavac provides various facilities, 
including the ability to start a background server, and to do "smart 
compilation" by  determining the reduced set of files that need to be 
recompiled.   The current build uses the first point (the ability to 
start a background server) but not the second.  It is my understanding 
that the background server is started by the first invocation of sjavac, 
which is given suitable parameters to enable it to do so.


-- Jon



On 2/27/19 7:51 AM, Erik Joelsson wrote:

Hello Andrew,

On 2019-02-26 12:09, Andrew Haley wrote:

I'm seeing a crash in the javac server while building openjdk.

We are seeing this too intermittently.

I want to run the exact same command that started the server running,
but even with LOG=debug I cannot find the command line that starts
it. The command seems not to be there at all.

So, how exactly does the javac server get started, and how do I find
the command line that started it?
The server is started lazily by the first javac invocation that needs 
it. There is a parameter given to javac that describes how it should 
be started, but to get the exact command line, you would have to 
instrument javac java source. You should be able to add additional 
parameters to that JVM, at least by editing spec.gmk, that could help 
you with diagnostics.

And, incidentally, given that I'f configured with --disable-sjavac,
why is the build running a javac server? Thanks.

The "smart javac" and the javac server are not one the same. The 
server was introduced in sjavac, but the server part was later ported 
over to javac proper (I think). So now we have two configure 
arguments, --enable-sjavac and --disable-javac-server. The latter is 
what you are looking for.


I think we should really get rid of sjavac since the relevant benefits 
are already present in the default build, with the javac server and 
the dependency plugin. The only possible benefit of sjavac today would 
be more fine grained incremental build support, but I doubt it works 
very well given that it's not being maintained.


/Erik



Re: How can I see where the sjavac_server is started?

2019-02-27 Thread Erik Joelsson

Hello Andrew,

On 2019-02-26 12:09, Andrew Haley wrote:

I'm seeing a crash in the javac server while building openjdk.

We are seeing this too intermittently.

I want to run the exact same command that started the server running,
but even with LOG=debug I cannot find the command line that starts
it. The command seems not to be there at all.

So, how exactly does the javac server get started, and how do I find
the command line that started it?
The server is started lazily by the first javac invocation that needs 
it. There is a parameter given to javac that describes how it should be 
started, but to get the exact command line, you would have to instrument 
javac java source. You should be able to add additional parameters to 
that JVM, at least by editing spec.gmk, that could help you with 
diagnostics.

And, incidentally, given that I'f configured with --disable-sjavac,
why is the build running a javac server? Thanks.

The "smart javac" and the javac server are not one the same. The server 
was introduced in sjavac, but the server part was later ported over to 
javac proper (I think). So now we have two configure arguments, 
--enable-sjavac and --disable-javac-server. The latter is what you are 
looking for.


I think we should really get rid of sjavac since the relevant benefits 
are already present in the default build, with the javac server and the 
dependency plugin. The only possible benefit of sjavac today would be 
more fine grained incremental build support, but I doubt it works very 
well given that it's not being maintained.


/Erik