Skip to content

Commit 3f3abd8

Browse files
committed
cleanup trailing spaces in README
1 parent 7896c14 commit 3f3abd8

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ retryLimit: 3
327327
# timeoutSeconds is for task handler timeout.
328328
# If set positive value, task handler timeout for processing this task.
329329
# Otherwise, worker's default timeout will be applied. (See 'Task Queue Worker' section)
330-
timeoutSeconds: 600
330+
timeoutSeconds: 600
331331
```
332332
333333
#### `Task`
@@ -344,8 +344,8 @@ spec:
344344
rertryLimit: 3
345345
timeoutSeconds: 100
346346
status:
347-
# Phase of the task.
348-
# See below section for task lifecycle
347+
# Phase of the task.
348+
# See below section for task lifecycle
349349
phase: Processing
350350
createdAt: 2020-02-12T20:20:29.350631+09:00
351351
# Failure count of the task
@@ -358,7 +358,7 @@ status:
358358
processUID: 7b7b39f5-da66-4380-8002-033dff0e0f26
359359
# worker name received the task
360360
workerName: everpeace-macbookpro-2018.local
361-
# This value is unique among pftaskqueue worker processes
361+
# This value is unique among pftaskqueue worker processes
362362
workerUID: 15bfe424-889a-49ca-88d7-fb0fc51f68d
363363
# timestamps
364364
receivedAt: 2020-02-12T20:20:39.350631+09:00
@@ -370,12 +370,12 @@ status:
370370
# NOTE: so, if you set larger value than this limit in spec.rertryLimit,
371371
# you will loose old task records.
372372
history:
373-
# TaskRecord:
374-
# this represents a record of task handler invocation
373+
# TaskRecord:
374+
# this represents a record of task handler invocation
375375
# in a specific worker.
376376
# UID of process(generated by pftaskqueue)
377377
- processUID: 194b8ad9-543b-4d01-a571-f8d1db2e74e6
378-
# worker name & UID which received the task
378+
# worker name & UID which received the task
379379
workerName: everpeace-macbookpro-2018.local
380380
workerUID: 06c333f8-aeab-4a3d-8624-064a305c53ff
381381
# timestamps
@@ -394,8 +394,8 @@ status:
394394
# - Signaled: pftaskqueue worker signaled and the task handler was interrupted
395395
# - InternalError: pftaskqueue worker faced some error processing a task
396396
reason: Succeeded
397-
# Returned values from the task handlers.
398-
# See 'Task Handler Specification' section for how pftaskqueue worker communicates
397+
# Returned values from the task handlers.
398+
# See 'Task Handler Specification' section for how pftaskqueue worker communicates
399399
# with its task handler processes.
400400
# payload max size varies on backend type to prevent from overloading backend.
401401
# redis: 1KB
@@ -405,7 +405,7 @@ status:
405405
# redis: 1KB
406406
# If size exceeded, the contents will be truncated automatically
407407
message: ""
408-
# Below two fields will be set if the worker which processes the task was
408+
# Below two fields will be set if the worker which processes the task was
409409
# lost and salvaged by the other worker.
410410
# See "Worker lifecycle" section below for details.
411411
# salvagedBy: <workerUID>
@@ -428,10 +428,10 @@ status:
428428
429429
If you queued your `TaskSpec`, `pftaskqueue` assign UID to it and generate `Task` with `Pending` phase for it. Some worker pulled a `Pending` task from the queue, `Task` transits to `Received` phase. When `Task` actually stared to be processed by task handler process, it transits to `Processing` phase.
430430
431-
Once task handler process succeeded, `Task` transits to `Succeeded` phase. If task handler process failed, `pftaskqueue` can handle automatic retry feature with respect to `TaskSpec.retryLimit`. If the task handler process failed and it didn't reach at its retry limit, `pftaskqueue` re-queue the task with setting `Pending` phase again. Otherwise `pftaskqueue` will give up retry and mark it `Failed` phase. You can see all the process record of the `Task` status.
431+
Once task handler process succeeded, `Task` transits to `Succeeded` phase. If task handler process failed, `pftaskqueue` can handle automatic retry feature with respect to `TaskSpec.retryLimit`. If the task handler process failed and it didn't reach at its retry limit, `pftaskqueue` re-queue the task with setting `Pending` phase again. Otherwise `pftaskqueue` will give up retry and mark it `Failed` phase. You can see all the process record of the `Task` status.
432432
433433
If worker was signaled, tasks in `Received` or `Processing` phase will be treated as failure and `pftaskqueue` will handle automatic retry feature.
434-
434+
435435
```yaml
436436
$ pftaskqueue get-task [queue] --state=failed -o yaml
437437
...
@@ -517,13 +517,13 @@ worker:
517517
# This value will be used when TaskSpec.timeoutSeconds is not set or 0.
518518
defaultTimeout: 30m0s
519519
# Task Handler Command
520-
# A Worker spawns a process with the command for each received tasks
520+
# A Worker spawns a process with the command for each received tasks
521521
commands:
522522
- cat
523523
# Worker heartbeat configuration to detect worker process existence
524524
# Please see "Worker lifecycle" section
525525
heartBeat:
526-
# A Worker process tries to update its Worker.Status.lastHeartBeatAt field
526+
# A Worker process tries to update its Worker.Status.lastHeartBeatAt field
527527
# stored in queue backend in this interval
528528
interval: 2s
529529
# A Worker.Status.lastHeartBeatAt will be determined "expired"
@@ -538,7 +538,7 @@ worker:
538538
exitOnEmpty: false
539539
# If exitOnEmpty is true, worker waits for exit in the grace period
540540
exitOnEmptyGracePeriod: 10s
541-
# If the value was positive, worker will exit
541+
# If the value was positive, worker will exit
542542
# after processing the number of tasks
543543
numTasks: 1000
544544
# Base directory to create workspace for task handler processes
@@ -597,10 +597,10 @@ status:
597597
+------------+
598598
```
599599

600-
Once worker started, it starts with `Running` phase. In the startup, a worker register self to the queue and get its UID. The UID becomes the identifier of workers. If worker exited normally (with `exit-code=0`), it transits `Succeeded` phase. If `exit-code` was not 0, it transits to `Failed` phase.
600+
Once worker started, it starts with `Running` phase. In the startup, a worker register self to the queue and get its UID. The UID becomes the identifier of workers. If worker exited normally (with `exit-code=0`), it transits `Succeeded` phase. If `exit-code` was not 0, it transits to `Failed` phase.
601601

602602
However, worker process was go away by various reasons (`SIGKILL`-ed, `OOMKiller`, etc.). Then, how to detect those worker's sate? `pftaskquue` applies simple timeout based heuristics. A worker process keeps sending heartbeat during it runs, with configured interval, to the queue by updating its `Status.lastHeartBeatAt` field. If the heartbeat became older then configured expiration duration, the worker was determined as 'Lost' state (`phase=Failed, reason=Lost`). Moreover when a worker detects their own heartbeat expired, they exited by their selves to wait they will be salvaged by other workers.
603-
603+
604604
On every worker startup, a worker tries to find `Lost` workers which are safe to be salvaged. `pftaskqueue` also used simple timeout-based heuristics in salvation, too. If time passed `Worker.HeartBeat.SalvagedDuration` after its heartbeat expiration, the worker is determined as a salvation target. Once the worker finds some salvation target workers, it will salvage the worker. "Salvation" means
605605

606606
- marks the target `Salvaged` phase (`phase=Failed, reason=Salvaged`)
@@ -633,26 +633,26 @@ pftaskqueue get-worker [queue] --state=[all,running,succeeded,failed,lost,tosalv
633633
```
634634
{workspace direcoty}
635635
636-
│ # pftaskqueue prepares whole the contents
637-
├── input
636+
│ # pftaskqueue prepares whole the contents
637+
├── input
638638
│   ├── payload # TaskSpec.payload in text format
639639
│   ├── retryLimit # TaskSpec.retryLimit in text format
640640
│   ├── timeoutSeconds # TaskSpec.timeoutSeconds in text format
641641
│   └── meta
642642
│      ├── taskUID # taskUID of the task in text format
643-
│      ├── processUID # prrocessUID of the task handler process
643+
│      ├── processUID # prrocessUID of the task handler process
644644
│      ├── task.json # whole task information in JSON format
645-
│      ├── workerName # workerName of the worker process
646-
│      ├── workerUID # workerUID of the worker process
647-
│      └── workerConfig.json # whole workerConfig information in JSON format
645+
│      ├── workerName # workerName of the worker process
646+
│      ├── workerUID # workerUID of the worker process
647+
│      └── workerConfig.json # whole workerConfig information in JSON format
648648
649649
│ # pftaskqueue just creates the directory
650650
│ # If any error happened in reading files in the directory, the task fails with the TaskResult below.
651651
│ # type: "Failure"
652652
│ # reason: "InternalError"
653653
│ # message: "...error message..."
654654
│ # payload: null
655-
└── output
655+
└── output
656656
├── payload # If the file exists, the contents will record in TaskResult.payload. Null otherwise.
657657
│ # Max size of the payload varies on backend type to avoid from overloading backend
658658
│ # redis: 1KB
@@ -666,7 +666,7 @@ pftaskqueue get-worker [queue] --state=[all,running,succeeded,failed,lost,tosalv
666666
# e.g. [{"payload": "foo", "retryLimit": "3", "timeout": "10m"}]
667667
668668
3 directories, 12 files
669-
```
669+
```
670670

671671
## Dead letters
672672

@@ -688,7 +688,7 @@ $ pftaskqueue get-task [queue] --state=deadletter --output yaml
688688
...
689689
```
690690

691-
## Managing configurations
691+
## Managing configurations
692692

693693
`pftaskqueue` has a lot of configuration parameters. `pftaskqueue` provides multiple ways to configure them. `pftaskqueue` reads configuraton parameter in the following precedence order. Each item takes precedence over the item below it:
694694

@@ -745,16 +745,16 @@ redis:
745745
# key prefix of redis database
746746
# all the key used pftaskqueue was prefixed by '_pftaskqueue:{keyPrefix}:`
747747
keyPrefix: omura
748-
748+
749749
# redis server information(addr, password, db)
750750
addr: ""
751751
password: ""
752752
db: 0
753-
753+
754754
#
755755
# timeout/connection pool setting
756756
# see also: https://github.com/go-redis/redis/blob/a579d58c59af2f8cefbb7f90b8adc4df97f4fd8f/options.go#L59-L95
757-
#
757+
#
758758
dialTimeout: 5s
759759
readTimeout: 3s
760760
writeTimeout: 3s
@@ -764,9 +764,9 @@ redis:
764764
poolTimeout: 4s
765765
idleTimeout: 5m0s
766766
idleCheckFrequency: 1m0s
767-
767+
768768
#
769-
# pftaskqueue will retry when redis operation failed
769+
# pftaskqueue will retry when redis operation failed
770770
# in exponential backoff manner.
771771
# you can configure backoff parameters below
772772
#
@@ -778,7 +778,7 @@ redis:
778778
maxElapsedTime: 1m0s
779779
# max retry count. -1 means no limit.
780780
maxRetry: -1
781-
```
781+
```
782782
783783
## Bash/Zsh completion
784784

0 commit comments

Comments
 (0)