Skip to content

Commit 96bdd90

Browse files
committed
Apply comments
1 parent 1ed3fb1 commit 96bdd90

File tree

3 files changed

+102
-1
lines changed

3 files changed

+102
-1
lines changed

common/scala/src/main/scala/org/apache/openwhisk/common/AverageRingBuffer.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package org.apache.openwhisk.common
219

320
object AverageRingBuffer {
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
19+
akka {
20+
extensions = ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]
21+
actor {
22+
allow-java-serialization = off
23+
serializers {
24+
kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
25+
}
26+
serialization-bindings {
27+
"org.apache.openwhisk.core.scheduler.queue.CreateQueue" = kryo
28+
"org.apache.openwhisk.core.scheduler.queue.CreateQueueResponse" = kryo
29+
"org.apache.openwhisk.core.connector.ActivationMessage" = kryo
30+
}
31+
kryo {
32+
idstrategy = "automatic"
33+
classes = [
34+
"org.apache.openwhisk.core.scheduler.queue.CreateQueue",
35+
"org.apache.openwhisk.core.scheduler.queue.CreateQueueResponse",
36+
"org.apache.openwhisk.core.connector.ActivationMessage"
37+
]
38+
}
39+
}
40+
41+
remote.netty.tcp {
42+
send-buffer-size = 3151796b
43+
receive-buffer-size = 3151796b
44+
maximum-frame-size = 3151796b
45+
}
46+
}
47+
48+
whisk {
49+
# tracing configuration
50+
tracing {
51+
component = "Scheduler"
52+
}
53+
54+
fraction {
55+
managed-fraction: 90%
56+
blackbox-fraction: 10%
57+
}
58+
59+
scheduler {
60+
protocol = "http"
61+
username: "scheduler.user"
62+
password: "scheduler.pass"
63+
grpc {
64+
tls = "false"
65+
}
66+
queue {
67+
idle-grace = "20 seconds"
68+
stop-grace = "20 seconds"
69+
flush-grace = "60 seconds"
70+
graceful-shutdown-timeout = "5 seconds"
71+
max-retention-size = "10000"
72+
max-retention-ms = "60000"
73+
throttling-fraction = "0.9"
74+
duration-buffer-size = "10"
75+
}
76+
queue-manager {
77+
max-scheduling-time-ms = "20000"
78+
max-retries-to-get-queue = "13"
79+
}
80+
max-peek = "128"
81+
in-progress-job-retention = "20"
82+
}
83+
}

core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/MemoryQueue.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ class MemoryQueue(private val etcdClient: EtcdClient,
626626
}
627627

628628
private def cleanUpActorsAndGotoRemovedIfPossible(data: RemovingData) = {
629+
requestBuffer = requestBuffer.filter(!_.promise.isCompleted)
629630
if (queue.isEmpty && requestBuffer.isEmpty) {
630631
logging.info(this, s"[$invocationNamespace:$action:$stateName] No activation exist. Shutdown the queue.")
631632
// it can be safely called multiple times as it's idempotent
@@ -642,7 +643,7 @@ class MemoryQueue(private val etcdClient: EtcdClient,
642643
} else {
643644
logging.info(
644645
this,
645-
s"[$invocationNamespace:$action:$stateName] Queue is going to stop but there are still ${queue.size} activations and ${requestBuffer.size} requst buffered.")
646+
s"[$invocationNamespace:$action:$stateName] Queue is going to stop but there are still ${queue.size} activations and ${requestBuffer.size} request buffered.")
646647
stay // waiting for next timeout
647648
}
648649
}

0 commit comments

Comments
 (0)