Skip to content

Commit c93d295

Browse files
committed
Merge branch 'dev' into main
2 parents 6506176 + a251be8 commit c93d295

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# version 3.0.1
2+
- bugfix in class MetricsFetcherBolt to prevent null message
3+
- bugfix in dependency linkchecker-persistence
4+
15
# version 3.0.0
26
- replacement of the persistence layer: the [resource availability status API (RASA)](https://github.com/clarin-eric/resource-availability-status-api)
37
is replaced by [curation-persistence](https://github.com/clarin-eric/curation-persistence)

crawler-test-conf.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ config:
4040
- fetch.redirectCount
4141
- http.method.head
4242

43-
http.agent.name: "CLARIN Linkchecker: https://www.clarin.eu/linkchecker (!!! TEST !!!)"
43+
http.agent.name: "CLARIN Linkchecker: https://www.clarin.eu/linkchecker"
4444
http.agent.version: "2.4"
4545
http.agent.description: "built with StormCrawler Archetype 2.4"
4646
http.agent.url: "https://www.clarin.eu/linkchecker"
@@ -128,7 +128,7 @@ config:
128128
spring.datasource.username: ${ENV-MYSQL_USER}
129129
spring.datasource.password: ${ENV-MYSQL_PASSWORD}
130130
spring.datasource.driver-class-name: org.mariadb.jdbc.Driver
131-
spring.jpa.show-sql: true
131+
spring.jpa.show-sql: false
132132
spring.jpa.hibernate.ddl-auto: none
133133
spring.database-platform: org.hibernate.dialect.MariaDBDialect
134134

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>eu.clarin.cmdi</groupId>
44
<artifactId>linkchecker</artifactId>
5-
<version>3.0.0</version>
5+
<version>3.0.1</version>
66
<packaging>jar</packaging>
77
<properties>
88
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
99
<storm.version>2.4.0</storm.version>
1010
<stormcrawler.version>2.4</stormcrawler.version>
1111
<lombok.version>1.18.24</lombok.version>
12-
<linkchecker-persistence.version>0.0.2</linkchecker-persistence.version>
12+
<linkchecker-persistence.version>0.0.3</linkchecker-persistence.version>
1313
</properties>
1414
<distributionManagement>
1515
<snapshotRepository>
@@ -195,7 +195,7 @@
195195
<dependency>
196196
<groupId>org.mariadb.jdbc</groupId>
197197
<artifactId>mariadb-java-client</artifactId>
198-
<version>3.1.2</version>
198+
<version>3.1.3</version>
199199
</dependency>
200200
</dependencies>
201201
<repositories>

src/main/java/eu/clarin/linkchecker/bolt/MetricsFetcherBolt.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,11 @@ else if (Configuration.restrictedAccessStatusCodes.contains(response.getStatusCo
659659
continue;
660660
}
661661

662-
String message = exece.getMessage();
663-
if (message == null)
664-
message = "";
662+
String message = exece.getMessage();
665663

666664
// common exceptions for which we log only a short message
667665
if (exece.getCause() instanceof java.util.concurrent.TimeoutException
668-
|| message.contains(" timed out")) {
666+
|| (message != null && message.contains(" timed out"))) {
669667
log.debug("Socket timeout fetching {}", fit.url);
670668
message = "Socket timeout fetching";
671669
}
@@ -690,9 +688,7 @@ else if (exece.getCause() instanceof java.net.UnknownHostException
690688

691689
metadata.setValue("fetch.category", getCategoryFromException(exece, fit.url).name());
692690

693-
metadata.setValue("fetch.message", exece.getMessage());
694-
695-
// metadata.setValue("fetch.startTime", Long.toString(start));
691+
metadata.setValue("fetch.message", message);
696692

697693
// send to status stream
698694
collector.emit(Constants.StatusStreamName, fit.t, new Values(fit.url, metadata, Status.DISCOVERED));

src/main/java/eu/clarin/linkchecker/bolt/StatusUpdaterBolt.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public synchronized void store(String url, Status status, Metadata metadata, Opt
9494
eu.clarin.linkchecker.persistence.model.Status statusEntity = new eu.clarin.linkchecker.persistence.model.Status(
9595
urlEntity,
9696
Category.valueOf(md.getFirstValue("fetch.category")),
97-
md.getFirstValue("fetch.message"),
97+
md.getFirstValue("fetch.message").length() < 1024?md.getFirstValue("fetch.message"): md.getFirstValue("fetch.message").subSequence(0, 1017) + "[...]",
9898
md.getFirstValue("fetch.startTime") != null?
9999
Instant.ofEpochMilli(Long.parseLong(md.getFirstValue("fetch.startTime"))).atZone(ZoneId.systemDefault()).toLocalDateTime()
100100
: LocalDateTime.now()
@@ -131,6 +131,7 @@ public synchronized void store(String url, Status status, Metadata metadata, Opt
131131
}
132132
catch (Exception ex) {
133133
log.error("can't save checked link \n{}", statusEntity);
134+
log.error("metadata:\n" + md.toString());
134135
_collector.fail(t);
135136
}
136137
}

0 commit comments

Comments
 (0)