[jira] [Updated] (DAEMON-377) Race in PID file handing in jsvc resulting in Tomcat running without a pidfile

2017-11-12 Thread Rustam Abdullaev (JIRA)

 [ 
https://issues.apache.org/jira/browse/DAEMON-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rustam Abdullaev updated DAEMON-377:

Attachment: daemon-377.patch

Attaching a patch that fixes a couple of races with pid file handling 
(including this issue).

Now the controller will lock and check that the pid file hasn't changed before 
deleting it.

Also fixed an issue with the version check that creates a pid file 
unnecessarily and never removes one.

> Race in PID file handing in jsvc resulting in Tomcat running without a pidfile
> --
>
> Key: DAEMON-377
> URL: https://issues.apache.org/jira/browse/DAEMON-377
> Project: Commons Daemon
>  Issue Type: Bug
>Reporter: Rustam Abdullaev
> Attachments: daemon-377.patch
>
>
> This issue is reproducible in FreeBSD under moderate load during a restart of 
> Tomcat 8 running via jsvc.
> The old jsvc controller process exits _after_ the new process is started, 
> deleting the new pid file with it. As a result, the jsvc starter process 
> fails with a timeout since it is waiting on the pid file to be created, which 
> never happens. The Tomcat process itself is *started without a pid file*.
> Example: (35659/35660 is the old jsvc process, 56362/56363 is the new jsvc 
> process):
> {noformat}
> 2017-11-08 09:36:59 35660 jsvc debug: Daemon destroyed successfully
> 2017-11-08 09:36:59 35660 jsvc debug: Calling System.exit(0)
> 2017-11-08 09:36:59 56362 jsvc debug: Switching umask back to 022 from 077
> (((/var/run/tomcat8.pid is written by 56362 here)))
> 2017-11-08 09:36:59 56363 jsvc debug: Using specific JVM in 
> /usr/local/openjdk8/jre/lib/amd64/server/libjvm.so
> 2017-11-08 09:36:59 56363 jsvc debug: Attemtping to load library 
> /usr/local/openjdk8/jre/lib/amd64/server/libjvm.so
> (((/var/run/tomcat8.pid is deleted by 35659 here)))
> 2017-11-08 09:36:59 35659 jsvc debug: Service shut down
> 2017-11-08 09:36:59 56363 jsvc debug: JVM library 
> /usr/local/openjdk8/jre/lib/amd64/server/libjvm.so loaded
> 2017-11-08 09:36:59 56363 jsvc debug: JVM library entry point found 
> (0x019DE640)
> {noformat}
> Restart script eventually times out:
> {noformat}
> >/usr/local/etc/rc.d/tomcat8 restart
> Stopping tomcat8.
> Waiting for PIDS: 35660.
> Starting tomcat8.
> /usr/local/etc/rc.d/tomcat8: WARNING: failed to start tomcat8
> {noformat}
> No PID file:
> {noformat}
> >ls -l /var/run/tomcat8.pid
> ls: /var/run/tomcat8.pid: No such file or directory
> {noformat}
> Yet Tomcat is running:
> {noformat}
> >ps ax|grep java|grep -v grep
> 56362  -  Is  0:00.00 /usr/local/bin/jsvc -java-home /usr/local/openjdk8 
> -server -user www -pidfile /var/run/tomcat8.pid -wait 300 -outfile /u
> 56363  -  I   0:57.25 /usr/local/bin/jsvc -java-home /usr/local/openjdk8 
> -server -user www -pidfile /var/run/tomcat8.pid -wait 300 -outfile /u
> {noformat}
> The issue is that the pidfile contains the PID of the _child_, but is being 
> deleted by the _parent_ process (the controller), in the {{run_controller}} 
> function which looks like:
> {code}
> static int run_controller(arg_data *args, home_data *data, uid_t uid,
>   gid_t gid)
>   . . .
>   waitpid(pid, &status, 0);
>   unlink(args->pidf);
> {code}
> If the controller process is paged out (which happens often because it is 
> dormant while inside {{waitpid}}), then considerable amount of time can pass 
> between the time the child terminates and the call to {{unlink(args->pidf)}}.
> The issue can be reproduced reliably by adding {{sleep(1);}} before 
> {{unlink(args->pidf)}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang issue #307: Fix TypeUtils.parameterize to work correctly with n...

2017-11-12 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/307
  

[![Coverage 
Status](https://coveralls.io/builds/14162875/badge)](https://coveralls.io/builds/14162875)

Coverage increased (+0.09%) to 95.26% when pulling 
**564f302d142251bd1f60ce4178a2cd994b39dcf1 on MaridProject:master** into 
**e863dcb2e7a654af6b8eb5865d8d1d8eee0a6d28 on apache:master**.



---


[GitHub] commons-lang pull request #307: Fix TypeUtils.parameterize to work correctly...

2017-11-12 Thread MaridProject
GitHub user MaridProject opened a pull request:

https://github.com/apache/commons-lang/pull/307

Fix TypeUtils.parameterize to work correctly with narrower-typed array

Currently the following code:
```
final TypeVariable[] variables = ArrayList.class.getTypeParameters();
final ParameterizedType parameterizedType = 
TypeUtils.parameterize(ArrayList.class, variables);
final Map, Type> mapping = Collections., 
Type>singletonMap(variables[0], String.class);
final Type unrolled = TypeUtils.unrollVariables(mapping, 
parameterizedType); // exception !
assertEquals(TypeUtils.parameterize(ArrayList.class, String.class), 
unrolled);
```
throws an exception.

So, I added a test and fixed the ParameterizedTypeImpl class.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MaridProject/commons-lang master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/307.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #307


commit 564f302d142251bd1f60ce4178a2cd994b39dcf1
Author: Dmitry Ovchinnikov 
Date:   2017-11-12T18:49:07Z

Fix TypeUtils.parameterize to work correctly with narrower-typed varargs 
array




---


[jira] [Closed] (MATH-1434) FisherTransform and InverseFisherTransform

2017-11-12 Thread nimo mayr (JIRA)

 [ 
https://issues.apache.org/jira/browse/MATH-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

nimo mayr closed MATH-1434.
---
Resolution: Invalid

Can be easily done with normal calculation:

fisher = arctanh(x).

So no need to implement this.

> FisherTransform and InverseFisherTransform
> --
>
> Key: MATH-1434
> URL: https://issues.apache.org/jira/browse/MATH-1434
> Project: Commons Math
>  Issue Type: New Feature
>Affects Versions: 3.6.1
> Environment: Please provide the *"Fisher equation" ("Fisher 
> transform") and its reverse*.
> Thanks.
>Reporter: nimo mayr
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)