Skip to content

Commit

Permalink
ftp: switch to more reasonable logging of Subject
Browse files Browse the repository at this point in the history
Motivation:

The `Subject#toString` method provides way too much information,
particularly for X.509 based identities, making it hard to find the
useful information.

In addition, in providing all this information, the `toString` method is
CPU intensive and requires thread serialisation.

Modification:

Update the logging to use dCache's `Subjects#toString` method.

Result:

The FTP door now provides more succinct information on pinboard, should
use less CPU and take better advantage of the available cores.

Target: master
Requires-notes: yes
Requires-book: no
Request: 7.2
Request: 7.1
Request: 7.0
Request: 6.2
Issue: #6195
Patch: https://rb.dcache.org/r/13246/
Acked-by: Dmitry Litvintsev
  • Loading branch information
paulmillar committed Nov 8, 2021
1 parent 84467de commit f7ebd14
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Set;
import javax.security.auth.Subject;
import org.dcache.auth.LoginNamePrincipal;
import org.dcache.auth.Subjects;
import org.dcache.dss.DssContext;
import org.dcache.dss.DssContextFactory;
import org.slf4j.Logger;
Expand Down Expand Up @@ -182,7 +183,7 @@ public void ftp_adat(String arg) throws FTPCommandException {
} else {
if (context.isEstablished()) {
LOGGER.info("GssFtpDoorV1::ftp_adat: security context established with {}",
subject);
Subjects.toString(subject));
reply("235 OK");
} else {
reply("335 ADAT=");
Expand Down

0 comments on commit f7ebd14

Please sign in to comment.